I just read this article on Ars Technica about time travel in movies. They rate twenty movies on entertainment value and science. The latter is more about how much account they take of how time travel could possibly work. Some movies make no effort to explain it. Some have used scientists to advise on how to use current theories, but in most it is just a plot device that may be used to add some historical scenes.
I watched The Time Machine many times as a kid. The book by H.G. Wells was one of the first to explore this topic.
Movies like Bill and Ted's Excellent Adventure or Back to the Future are pure entertainment, but the latter at least tries to show that there are consequences of meddling in the past. If you could then there is no reason why a person would fade out like Marty does. If he had not been born then he could not have travelled back anyway.
I do like this scene from the former though. It seems that having historical characters experience modern America did not change things, but then someone is trying to get the two heroes to live a different life to save the future.
People mention Groundhog Day in the article comments, but that seems that it involves magic rather than science.
A lot of these stories create loops such as in the Terminator movies where a robot goes back and gives people the technology that leads to the robots taking over. This is a case where there is a single timeline that can be changed whilst some theories say that time would branch. This is what a lot of the latest Marvel shows and movies are based on. Loki has explored that via the Time Variance Authority who try to keep things on 'The Sacred Timeline'. It has some Groundhog Day elements.
TV shows can be better than movies for science fiction as they can take time to develop their worlds and explore them deeper. Doctor Who has done that for sixty years now, but I would say it is low on science as there is no real explanation of how the Tardis works and there are mostly no consequences of meddling. Mind you, there have been some stories where someone tried to change the past, but that usually ends badly. I am still a Doctor Who fan anyway having grown up with it.
A show I enjoyed fairly recently was Timeless. Some bad people steal a time machine with the intention of changing history. Even when they are thwarted there can be ripples and the good guys find some things have changed when they get back to their own time. Of course the creators have fun with all the history stuff.
Another good one was the German show Dark. A small town has portals that can take you to the past or future. I really enjoyed it, but it did get pretentious at times.
I have read plenty of books that feature time travel too. Mr Wells really kicked off something. It is hard to imagine how travel to the past could work. We are all travelling into the future and there ways we could accelerate that, but possibly with no way back.
So what is your favourite movie, TV show or book about time travel? If you had a time machine, when and where would you go to?