Alien invasions, artificial intelligences ruling and often ruining the world, humans fighting against seemingly perfect but almost always evil ruling authorities: these and more make the star-studded sci-fi genre in the broader category of speculative ones fiction out.
Some of the common tropes (a literary device used repeatedly) in science fiction that you might recognize are: oxygen leaks, time travel, evil robots/artificial intelligence, and faster than light (how else can the characters save the galaxy?) .

Much like fantasy has two major categories - high and low - so does sci-fi. But the two overarching categories in sci-fi are hard and soft and don't relate to the texture of anything in the story ;).
Hard sci-fi is for science lovers and nerds :). In these books/movies, the creators are careful to be as accurate as possible with every scientific detail and include the more "exact" sciences like engineering and science. Soft Sci-Fi is more concerned with the less exact sciences: sociology, anthropology or psychology and less concerned with getting all the technical details right.
HowFantasies, Sci-Fi consists of many subgenres, all of which could fit into either the hard or soft categories. For a more complete list of all sci-fi subgenres, clickHere.
Types of Science Fiction:
Alien-Invasion: An often technologically superior extraterrestrial company invades Earth with an evil intent, whether to enslave humans, eat them, or use the planet for other destructive purposes.
Examples:skywardby Brandon Sanderson,The sound of the starsby Alechia Dow
Alternate History: This subgenre asks the question: What if history had gone differently? This type of fiction consists of a change that causes the story to differ from the story we know.
Examples:The blind assassinvon Margaret Atwood,Farnhams Freeholdby Robert Heinlein
Alternative/Parallel Universe:This type of fiction has a self-contained separate reality that coexists with our own and can vary from a small geographic region to an entire universe.
Examples:The space between the worldsby Michael Johnson,A thousand pieces of youby Claudia Grey
Apocalyptic/Post-apocalyptic: Apocalyptic stories set in a world reaching the end of civilization through nuclear war, plague or other cataclysm. Post-Apocalyptic is set in a place where such a catastrophe has already happened, where the survivors must deal with the aftermath, be it days after the catastrophe or years.
Examples:Station elfvon Emily St. John Mandel,Oryx and Crakevon Margaret Atwood
Artificial intelligence: Any story that has artificial intelligence (AI) as its main theme. AI is a branch of computer science that deals with intelligent behavior, learning and adaptation in machines.
Examples:Robocalypseby Daniel H Wilson,Partialby DanWells
Colonization:Life forms (usually humans or insects) move to a distant area where their kind is sparse or non-existent and establish new settlements in the area.
Examples:Road of Desolationby Ian McDonald,spokesman for the deadby Orson Scott Card
Cyberpunk: This name comes from cybernetics (replacing body parts with machines, like a cyborg) and punk. It is characterized by advanced technology - computers or information technology - coupled with some degree of breakdown in social order. The main characters are often marginalized, alienated loners living on the fringes of society.
Examples:snow crashvon Neal Stephenson,ashby Marissa Meyer
Dying Earth:This subgenre is similar to apocalyptic/post-apocalyptic as the end of the world is imminent. But unlike these, the end of the world is only due to the natural laws of the universe, where the sun fades and the earth dies (poor thing!).
Examples:The Dying Earthby JackVance,The time machineby H.G. Wells
dystopia: Some people argue that this is its own genre under the speculative fiction umbrella. Regardless, many science fiction books fall into this category, in which the world is the opposite of a utopia: more of a nightmare. Often the world is presented as good/perfect/utopian, but the reader quickly finds out that it isn't. (Fun fact: this is the sci-fi genre I've read the most about).
Examples:Sense by Neal Shusterman,The Givervon Lois Lowry
First contact:Contains the first encounter between humans and aliens (or any two sentient races). Unlike Alien Invasion, the aliens in this subgenre aren't necessarily hostile.
Examples:A dark seavon James L. Cambias,saturn runvon John Sandford
Galactic Empire: Any books with such a Galactic Empirewar of stars
Examples:Stiftungseries by Isaac Asimov,The missing birdsvon Simon Jiménez
ship of the generation: A subgenre in which characters travel on a type of spaceship called generation ship, which is much slower than light between stars. Since they travel so slowly and could take thousands of years to reach their destination, the original occupants would die during the journey, leaving their descendants to continue the journey (that would be harsh!).
Examples:Hull Zero Threeby GregBear,through the universeby BethRevis
Human development: Books in which science or nature has given people improved mental or physical abilities.
Examples:Ascent of Olympusvon Kevin J. Anderson,city at the end of timeby Gregory Bear
Immortality:Stories that explore what an endless or infinitely long human life would be like, or if it's even possible.
Examples:The City and the Starsby Arthur C Clarke,How to stop timeby MattHaig
Light/Humorous SF: Another broader subgenre that includes all science fiction books that contain humorous science fiction.
Examples:The Hitchhiker's Guide to the Galaxyby Douglas AdamsThe cat that walks through wallsby Robert A. Heinlein
Military: War as a solution to interstellar or interplanetary conflicts forms the main or subplot of these stories. The main characters are often part of the military.
Examples:Kugelblitzvon Cixin Liu,The Light Brigadevon Kameron Hurley
Banal:Characters remain down to earth in this subgenre, and there's a credibility to the use of science and technology at the time the book was written.
Examples:The terminal manby Michael Crichton,The wife of the time travelervon Audrey Niffenegger
mutants: Characters that display powers often like superheroes. Unlike the human development subgenre, these powers arise naturally rather than through experimentation. Think zombies rather than Teenage Mutant Ninja Turtles (unfortunately).
Examples:I am Legendvon Richard Matheson,The Strange Case of Dr. Jekyll and Mr Hydevon Robert Louis Stevenson
Nanotechnology: Books that focus on this type of science, which involves designing and producing nanoscale (which is extremely small!) devices and/or systems.
Examples:preyby Michael Crichton,Das Diamantzeitatervon Neal Stephenson
Near future: These stories are set in the present or in the decades to come, and the setting should be reasonably familiar to the reader. The technology is often current or developing.
Examples:The heart goes lastvon Margaret Atwood,good morning midnight, von Lily Brooks-Dalton
robots and androids: Books about robots and androids!
Examples:I robotby Isaac Asimov,rebel wingsby Andrea Tang
Science-Fantasy: This subgenre represents works that use key elements of both genres to create a futuristic and technical story with fantastic subplots and characters. Or a book which, according to Arthur C. Clarke, "contains any sufficiently advanced technology indistinguishable from magic."
Examples:pivot pointnovels by Anne McCaffrey,remote controlvon Nnedi Okorafor
space exploration: That's pretty easy. Any story related to space exploration, including all the politics, science and engineering behind spaceflight. Let's touch the stars!
Examples:The Martian Chroniclesvon Ray Bradbury,The Sparrowvon MaryDoriaRussell
space opera: I had heard this term many times, but I didn't know what it meant. Space operas are usually set in outer space or on a planet far away. These are adventurous books that emphasize space warfare, drama, interplanetary battles, chivalric romance, and grand stakes. It's often soft science, but not necessarily.
Examples:to yesterdayby Frank HerbertAurora risesby Amie Kaufman
Steampunk: Very similar to the subgenre in fantasy where the focus is on steam powered technology. However, unlike the fantasy subgenre, the focus is more on the science and how the technology works. However, the line between the two is blurred!
Examples:bikeby Cherie Priestshadow of selfby Brandon Sanderson
Terraforming: Books about modifying a planet or moon to make it more habitable.
Examples:Ringweltby Larry Niven,dying of the lightby George R.R. Martin
time travel: Moving between different times or universes. (In fantasy it's called a portal and has nothing to do with science).
Examples:time savervon Wesley Chu,The Reluctant Assassinby Eoin Colfer
raise: When an advanced civilization aids the development of another by bestowing sentience, space travel abilities, or other assistance to a non-sentient species.
Examples:The end of childhoodby Arthur C Clarke,The Uplift Warby David Brin
Utopia: Unlike dystopia, where the world is supposed to be perfect but went wrong, in utopia books the world is still perfect.
Examples:Men like godsby H.G. Wells,The memory of the earthby Orson Scott Card
Virtual reality: Books in which virtual reality (a technology that enables a person to interact with a computer-simulated environment) plays an integral part of the plot and/or setting.
Examples:war crossby Marie Lu,Ready player oneby Ernst Cline