I have bundled together fantasy and science fiction writing because, on the face of it, they have a lot in common. But there is one crucial difference between them...
Science fiction is defined more by its setting than by other story elements (such as plot or characters). The novels might be set in a future version of earth, in a past version of earth that contradicts known history, in outer space, under the ocean.
Science and technology always lays at their core - not science and technology as we know it, but a theoretical future version of it, such as time travel, which goes against the known laws of nature today.
(It goes without saying, therefore, that if you are interested in writing s.f. novels, you need to be just as interested in technology as you are in creative writing.)
Science fiction is sometimes referred to as speculative fiction, simply because it speculates about what might be.
(And, incidentally, it is often proved right. There were novels about man landing on the moon long before man actually landed on the moon. And Flash Gordon's ray gun is today's laser!)
Here are some of the sub-genres to consider...
Fantasy fiction tends to be set in fanciful, invented worlds or alternate realities, or in a legendary and mythic past. The fantasy world will be a scientifically impossible one, but will nevertheless have its own internal logic and "laws."
Magic, mysticism and the supernatural play a large part.
Fantasy fiction frequently overlaps with science fiction and horror fiction, though there are clear differences...
(Note the "generally", though - the laws governing what the various fiction genres should and should not contain are very fluid.)
When writing a fantasy novel, your novel's protagonists might start in the real world and be drawn into the fantasy world, or the story might occur totally in the fantasy world setting. Alternatively, the novel might be set in an ostensibly ordinary world into which the fantasy element leaks.
If you aspire to write fantasy fiction, you are limited only by your imagination and your ability to create entire worlds, including the rules that govern it and the creatures that populate it. Study writers like J. K. Rowling, J. R. R. Tolkien and Terry Pratchett for inspiration.
If writing science fiction or fantasy is not for you, then take a look at some of the Other Categories of Fiction...