I don't really anticipate the extinction of humanity so much as the collapse of civilization.
Nuclear war -- A full-scale WWIII style scenario such as was anticipated during the Cold War could come close to an extinction level event. Even then, I would expect a few percent of humanity to survive, but civilization would probably collapse into a full-frontal post-apocalyptic scenario. That was then. Today the more likely nuclear war scenario theses days is a smaller regional nuclear war, such as India-Pakistan, Iran-Israel or North Korea nuking Seoul, Hawaii and maybe California and the US responding with nuclear weapons. It would rock the world and cost millions or tens of millions of lives, but it wouldn't be an extinction level event. It might trigger a global scramble as other countries try to reposition their own fortunes, so it might be accompanied by lots of conventional war as the globe rebalances.
Ecological collapse -- I expect many animal species to go extinct in coming years, but humanity will continue to multiply. I don't expect climate change to have a big impact for many years to come.
Major Asteroid Impact -- Huge extinction level impact, but correspondingly low probability. Might conceivably kill all life on Earth, even bacteria.
Supervolcano -- Higher probability but lower impact. Not an extinction level event, but it might trigger big global economic and geopolitical changes.
Nanotechnology -- A bigger danger than many people think, but not something I worry about at night. The end-of-the-world potential would depend on what kind of nanotechnology it was and what it did.
Synthetic biology - Like nanotechnology, but higher probability and greater potential lethality. I can imagine genetically engineered things escaping from labs (or being released by doomsday cultists or by teen-aged zit-faced basement biohackers for LOLs) that spread as easily as the common cold and are 100% fatal. Millions, hundreds of millions, billions of deaths, coronavirus style lockdowns on steroids, martial law, economic and social collapse, radio and TV signing off for the last time... Maybe a few survivors, maybe not. Either way, our world gone for good.
AI -- For some reason I've never seen this one to be as big a threat as many people do. We will need to see AIs that are general cognizers able to think about anything, not just the tasks they were designed for.
Global System Collapse -- I think that this one is probable, and perhaps coming soon. I don't expect industrial civilization to disappear though it will probably shrink. I do expect Western Civilization to collapse. We are already seeing that starting. The future isn't likely to be a place that most of us will find attractive, a place that still values free thought and individual liberty. With the end of free thought, scientific advancement will slow, intellectual life with become rote and formulaic, and the world might slip into a sort of cultural stasis, where culture doesn't change a whole lot from century to century.