Okay, not really the world, just civilization as we know it. There's all kinds of ways people have ended the world. Sometimes that's the story. Sometimes it's the backstory to a post-apocalyptic adventure.
There are, of course, a few common ones.
Nuclear war seems to be on a comeback after seemingly falling out of favour for a while after the Cold War ended. It's a fairly realistic one, too, even if a lot of post-nuke fiction gets a bit too gonzo.
Plagues are another realistic one and COVID-19 kind of reinforced that, even if it did not prove civilization-ending itself.
Asteroids or similar celestial phenomena as the cause of our downfall have actually been around for a long time. When Worlds Collide dates to the thirties as a novel (a film followed in 1951) and has another planet on a collision course with Earth. Of course, since the realization that an asteroid impact caused, or at least contributed to, the downfall of the dinosaurs, this now seems a lot more realistic than maybe it did back then.
Then there's zombies, which became popular after George Romero's "Living Dead" movies came out. Sometimes they fall under the "plague" category but not always. In Night of the Living Dead, the cause is never identified though there's mention of a satellite mysteriously crashing to Earth. In the horror-comedy Return of the Living Dead, it's experimental nerve gas that starts the ball rolling. So, really, they are kind of a thing unto themselves that sometimes overlaps with others.
Alien invasion. One of the oldest in modern literature, dating to H. G. Wells' still classic The War of the Worlds (serialized in 1897, published as a novel in 1898). The reasons for these invasions vary. Some are full-on military invasions (e.g. the aforementioned War of the Worlds), some are trojan horses (e.g. the TV series V), still others are subtle infiltrations (e.g. the various iterations of Invasion of the Body Snatchers). And, yes, zombie alien invasions are a thing.
Any favourites? If you were doing apocalyptic/post-apocalyptic fiction, how would you end civilization as we know it?
Yes, I'm contemplating whether to do something in this vein, if not now then eventually.