According to the Oxford dictionary, speculative fiction is a genre of fiction that encompasses works in which the setting is other than the real world, involving supernatural, futuristic, or other imagined elements. For example,
“this classic of speculative fiction imagines an extraordinary global occurrence that forces Earth’s men and women to exist in parallel dimensions”
Here is a helpful list found on the Masterclass website regarding speculative fiction.
Sub-genres of Speculative Fiction
Most speculative fiction novels fall under at least one of the following genres. Some may fall into multiple genres depending on the story structure:

Science fiction: stories with imagined technologies that don’t exist in the real world, like time travel, aliens, and robots.
Sci-fi fantasy fiction: sci-fi stories inspired by mythology, folklore, and fairy tales that combine imagined technologies with elements of magical realism.
Supernatural fiction: sci-fi stories about secret knowledge or hidden abilities including witchcraft, spiritualism, and psychic abilities.
Space opera fiction: a play on the term “soap opera,” sci-fi stories that take place in outer space and center around conflict, romance, and adventure.
Urban fantasy fiction: fantasy stories that take place in an urban setting in the real world but operate under magical rules.
Utopian fiction: stories about civilizations the authors deem to be perfect, ideal societies.
Dystopian fiction: stories about societies deemed problematic within the world of the novel, often satirizing government rules, poverty, and oppression.
Apocalyptic fiction: stories that take place before and during a huge disaster that wipes out a significant portion of the world’s population. The stories center around characters doing everything they can to stay alive—for example, running from zombies or trying to avoid a deadly plague.
Post-apocalyptic fiction: stories that take place after an apocalyptic event and focus on the survivors figuring out how to navigate their new circumstances—for example, emerging after a global nuclear holocaust or surviving a total breakdown of society.
Alternate history fiction: stories that focus on true historical events but are written as if they unfolded with different outcomes.
Superhero fiction: stories about superheroes and how they use their abilities to fight supervillains.
Margaret Atwood’s Handmaid’s Tale is a modern example.