In science fiction, books, TV shows, or films there are a few different types of “science” that the authors use. In good science fiction the authors know the difference between these types.
SCIENCE OF SCALE
This is my favorite type of Science in Science Fiction. The author takes either a real piece of science that has been proven to work, or at least had a successful proof of concept and scales it up greatly.
In the first science fiction story that I sold, LONG TERM THINKING, that is what I did. I looked at Buckypaper, carbon nanotubes weaved together and placed in enamel to make a material stronger than steel but could cover a football field and weigh less than a gram, and scaled it up to a ridiculous size. I covered an entire red dwarf star with it having it change from being transparent to reflective so it could amplify the light on a planet making it habitable.
The nice thing thing about using real science and scaling it up is that first of all it is a challenge as the story has real physical rules that can't be changed on a whim. It also makes the technology almost a side character that responds in a realistic way. Also it will stand up through the years as the science behind it will still hold, now and a hundred years from now. Jules Verne was a master of using real science in his novels and they are still enjoyable as his science is still valid.
In the world of more advanced physics scientists come up with ideas that are supported with mathematics but we don't have the resources to test them yet. Like if you want your characters to travel to another star there are a few hypothetical ways. You can have a ship powered by a small black hole that uses Hawkin's Radiation to power it and it could reach the nearest star in 6 years. You can accelerate a mass that is the same size as your ship to speeds nearing the speed of light and it will create a wave of anti-gravity that will transfer its velocity to the your ship when it hits it, instantly making that ship and occupants travel at near the speed of light without feeling any acceleration. There are many more hypothetical ways to do this.
The problem with using hypothetical science in a science fiction story is that it is not proven. That means as technology advances some of the hypothetical science will be shown to work, others won't. Using hypothetical science in science fiction is tricky as you have to be prepared for it to be disproved. So an author using hypothetical science should make sure the story doesn't revolve around that science.
This is science that only exists within the universe that writer has made. Star Trek is the best example as they have had over a thirty year run making a universe that has its own physics.
The anti-matter powered warp drive that they use simply could not generate enough power to work, but they have made their own laws to govern it and sort of stick to it.
The Transporter, which was written in at the last minute because Roddenberry didn't have the budget to land them on a planet once a week without it looking cheesy, relies on the Heisenberg Compensator to make up for the fact that it would violate the Heisenberg Uncertainty Principal.
When you start making up science to make your story work you are bordering on Fantasy, or in Star Wars just writing fantasy and putting space ships and stuff in your fantasy. There is nothing wrong with this but you must follow the rules of fantasy writing keep your made up physics consistent.
USING THESE TYPES OF SCIENCE
A good science fiction writer should know which type of science they are using in their story or their science will take away, rather than add to the story. If you're using Technobabble and one of your rules doesn't work to move your story, you can add another piece of technobabble to fix that problem. If you are using real science or even hypothetical science and something doesn't work, throwing in some tecnobabble will destroy the universe you've worked so hard to create.