We're the most adaptable species ever to live on this planet . There are 8 billion of us on every continent except Antarctica, and we've found ways to codify and share our collective knowledge.
Climate disasters, widespread thermonuclear wars, etc would be horrifying and would likely kill a great many or even a majority of humans. But even that wouldn't do much more than slow us down a few hundred years.
Even an a massive impact from space on the scale of the Chicxulub impact would kill off most people, and collapse civilization - but we'd rise again in less than a thousand years.
It's very hard to think of a scenario that would actually end us. One thing I've speculated about is maybe we unlock some awful power that we can't control. For example, if it were easy for anybody to distill antimatter in their garage in large quantities. Because there are always going to be those among us who want to burn it all down and who would destroy everything if they could. In a hypothetical world where terrorists and rampagers attacked with kilograms of antimatter, that might make it difficult to maintain a level of civilization for long periods of time.