I was chatting with someone new to writing recently and it got me thinking about some of the best writing advice I've learned over the years, especially when it comes to science fiction and fantasy. This person had already mastered most of the grammar and word choice issues (active vs. passive tense verbs) and sentence structure.
Too many writers who have never hired an editor write stiffly, mechanically, and passively. It's cringey (at least to me). It's why I gave up on critique sites--too many beginners with good ideas who don't know how to manifest those ideas into readable text. The best way to write well is to read good writing. Critiquing bad writing is like only breaking colts--until you work on the refinement of writing (training), you will never be a truly good writer (rider). I learned that in my writing and by training intensely in dressage in my riding. (Top riders ride all level of horses, because the upper levels keep their refined skills sharp and their skills bring up green horses the right way; versus those who only start horses and never get to practice and feel the very subtle and delicate balance of more advanced horses.)
The lesson there is: hire a professional editor, at least a few times, so that you can learn what you don't know, especially about your own writing. If you can learn to self-edit, that's great, but having someone else at least get you going down the road to better writing puts you many steps ahead in your skills (like I did with hiring an editor early in my writing career who made a huge difference in teaching me better writing that critique amateurs weren't helping me learn, and then again with dressage in regular lessons to teach me what I needed to do to improve my skills training my horse beyond the basics).
One thing that my early hiring of a professional editor taught me is to use all the senses, where they apply anyway. (That poor editor suffered through my awful early writing, bless her heart.) It adds color to a scene to experience more than what you see happening. Try writing a scene in the dark as a test. Our other senses are enhanced when we can't rely on what we see. With your characters, you'll have to think about what they experience in their other senses when they can't see. This is a good way to get into practice. Or write about a meal setting. Whatever it takes to get into practice and start thinking about all the other senses beyond sight will help you begin to help your characters experience the world more fully and immerse your readers.
However, don't use sense verbs (feel, hear, see, smell, taste) but describe something in a way that stands out. Instead of saying something like "She felt cold." try "The cold bit down to her bones."
That leads me to the next point in enhancing your writing. The most basic advice is to write in an active voice as much as possible and minimize the passive voice. Initially, newbie writers will take this to the extreme of NO passive voice, but that's not the case. It should be pretty easy to understand why this is such a big rule, especially in fiction. Active voice adds flavor to the writing and, in close third and first person, can define a character. "The sun burned down upon him." sounds a lot better than "the sun was hot and bright." Passive voice has its place, but use it sparingly. It's dry and dull. Your writing should jump off the page, but too much of that jumping desensitizes the reader for that turn of phrase that should really catch them. That's why I don't condemn passive voice. It has its place. Mix it up, but learn to do it in the right way so that the points that you want to emphasize stand out.
Dialogue is not narrative. Narrative is the author telling the reader what's going on, but dialogue is the character telling the reader indirectly in their conversations with other characters. The writing of dialogue should reflect the character's personality, not the author's. Listen to how people talk. Rarely do we speak in grammatically perfect sentences. We all make mistakes. However, on the page, you want to minimize that. The littlest hint of some of our spoken mistakes is enough to give flavor to a conversation or character.
Dialogue adds layers in other ways, too. Word choice of a particular character can make them stand out. And there are also the pronunciations. In science fiction and fantasy, I sometimes have a species whose language doesn't have certain sounds (the way German doesn't have the "th" sound, for instance) or has certain ways of pronouncing things (like a native French speaker versus a native English speaker--very different when trying to pronounce each other's words).
(Dialogue is so much more, but others have explained it well already. For instance, dialogue can imply or infer to the reader what's happening in action so that less narrative is needed.)
When it comes to setting, the reader only knows what's on the page. That doesn't mean go overboard and put in every single detail, but it does mean, especially in science fiction and fantasy, that you need to explain some things. How you do that without info-dumping is the trick. Sometimes you can't get away from explaining something, but doing it in appropriate places, such as where the character is thinking about it, and keeping it as short as possible, will help move the writing forward. Info-dumping slows the story and can turn off readers. However, not being able to imagine your fantastical world can also turn off readers, because they will be lost. Some things you can get away with implying, especially with readers who have read extensively in the genre. However, never assume all readers will know; any reader could be reading your book as their first foray into your genre. The best way to handle this is to keep it to just one or two sentences where you can when something is introduced for the first time.
On those lines, the same goes for sprinkling in background details or the history necessary to understand some points in a story.
Last of all, everything can be fixed in editing. The more perfect you think your work is, the more work it likely needs in edits. In the beginning stages, you will think you have the next bestseller, but too often that arrogance will blind you to the immensity of flaws. Step back, put it aside, work on something else, and give yourself time away. When you go back to that wonderful story, the veneer will be gone. Stepping out of the story will give you a chance to see it as an outsider would. You'll see it for what it really is. Then, you'll be ready to tackle all the flaws and give it the polish it needs. It's that time and mental distance from a work that will allow you to have the perspective you need to be objective about it.
At some point, you're going to get good at writing and begin to see how far you've come. You'll refine the work in ways you hadn't thought possible. At that point, you want to keep editing and keep refining, because you'll have been humbled into realizing that it could always be better. Know when to quit. Don't over-edit. You can ruin your voice and turn a bright, exciting story dull. No one is perfect.
Writing is an art form. It takes time and practice to become a master of the tools of the trade.