The judicial system, the laws of physics, the limitations of magic and other laws are all ones to consider when you write speculative fiction. Not only must you decide the laws of your own world and universe, you must ensure characters abide by them and that these characters understand them or grow to understand them. It can be an arduous process but it is a necessary one.
Decide the rules
First, you need to decide the rules. Can spaceships surpass the speed of light? Can magic be used to revive the dead? Do the molecules in the universe work the same way as on Earth?
In my own preferred genre, fantasy, the rules of magic differ per story I write. Not only are there rules for casting the magical spells or using magical items, there are also limitations that are either dependent on a person’s own strength or on the items they use or the experience they have. Decide this for your own world.
Point it out
Next, you need to point it out. Early on in your story, you need to make your audience aware of the magic in your world or the sci-fi technology that can be used. Give a brief introduction that gives the reader a reasonable understanding of what these features can do and what they can not.
Make it matter
Obviously enough, make sure the principles you put into place actually matter. Perhaps the magic faded in your current world so that other challenges exist now but then bring it back at one point so it actually matters that it ever existed. A spaceship can break but implement its existence somewhere so it still matters. This goes for every aspect of your story you decide to implement; make it matter.
Explain it; all or nothing
Personally, I am someone who will explicitly explain what a character does to summon magical powers during the start of a story. I will implement their thoughts, their emotions, their focus, their movements and even their breathing. Why? Because I want to explain the how of the magic in my world. How do people summon it? How do character use it? How do characters control it? How do characters experience it? I like to put in as much detail about this as is humanly possible.
However, that is one of two options when working with magic or speculative technologies. Either you explain everything to the best of your ability (in which case; make sure you understand it yourself through and through) or explain nothing. Yes, I am aware that there are halfway points where you could leave it at, but that is likely very unsatisfying. People are curious by nature. If you are going to explain something to them, give them all the details or they will feel like you are either holding something back or are not sure of the situation yourself.
The option where you explain nothing is also fine. Simply make the features matter and leave it at that. Drive the story forward and distract the audience by the amazing things your world’s features can do. That too is thrilling.
Choose what works for you, for your writing style and for your world.
Play with it
Now I know I have put strict rules up here, but that does not mean you can no longer be creative with it. Surprise yourself, your readers and even your characters by allowing them to implement the magic or technology in unexpected ways. Or, use it for mundane things (invisible umbrellas to ward off rain) to give the magic an overwhelming existence.
I hope this helps or inspires.
Write on, my fellow creatives!
May destiny be kind to you.