Okay, this is my oversimplified version of Warhammer 40k, there's a lot of lore in the 40k universe but, let's get to the point *inhales* Warhammer 40k currently (as of 9th edition) takes place in the early 42nd millennium (41,000 in the Gregorian calendar), the galaxy, is on fire, both figuratively and literally in some cases. All of this is due to the formation of the Great Rift in ca. 999.m41 (40,999), a rift that caused the Imperium of Man (Humans) to almost split into 2, the normal Imperium and the Dark Imperium. Why is called that? Because the Astronomican, the lighthouse that guides navigators through the chaotic immaterium.
It's powered by the Emperor of Man who is immobilized on the Golden Throne due to the Horus Heresy, 10 thousand years ago. The throne is the Emperor's life support and he guides the navigators. But when the rift formed, navigators on the opposite side of Terra (where the Dark Imperium is), had a very hard time going through the immaterium.
But when Guilliman was resurrected from stasis, he stabilized the Ultramar region and began a crusade to get to Terra called the Terran Crusade. There, he fought his former ally and brother, Magnus the Red on Luna (the moon) where after fighting, he made contact with the Emperor after 10 thousand years and the Emperor talked to Guilliman as if he was a tool.
Why? Because the Emperor before he was on the throne, he created 20 sons (21 if you count Omegon as a person) called Primarchs, however, the Chaos Gods didn't want the Emperor too become a major problem, so they launched the gestating Primarchs away from Terra onto inhospitable worlds like Fenris (Space Wolves) or Caliban (Dark Angels).
However, 2 Primarchs (2nd and 11th Primarchs) are removed from all Imperial records and 9 of them turned to Chaos around M31, causing the Horus Heresy, a nine year long, galaxy wide conflict.
After that, Guillian ordered the Adeptus Mechanicus to create a new generation of Space Marine, the Primaris Marine. A faster, stronger, overall, better type of Space Marine due to 22 gene-seed organs instead of 19 gene-seed organs, but the older generation isn't being phased out (as of right now).
There's a lot of lore in Warhammer 40k and I only focused on the Imperium and Space Marines, there are other factions like the Asuryani (or Eldar), a psionicly gifted race of elves that's nearing extinction due to the birth of Slaanesh about 10 millennia ago, the T'au, a young race with much potential, they seek to-