There are many alternatives to "extinction". In the 1950s economists were sure the world was doomed, food production was not coming even close to demand and people theorized about Malthusian Economics, where population growth far exceeds food supply and most of the world begins to starve. Then new advances in agriculture yielded much higher crop yields, we produce far more food than we need even to this day although we are not good about distribution, waste, etc which is why people still starve - but not nearly as bad as its been in the past, when a bad winter could mean significant death worldwide from starvation.
In the 1970s economists were absolutely sure we were reaching peak oil, as discovered oil reserves were dwindling and they were sure that oil would cost over $50 a gallon and trigger massive global wars between superpowers. It never came to pass, shale oil and other technological advances have led to an absolute glut of oil and we have more oil available today and in the future than we can possibly use.
There are tons and tons of other examples of this kind of "WE ARE DOOMED" thinking from nuclear war to Islamic Terrorism. Maybe climate change will be the one that diminishes humanity. Its unlikely (barring a massive asteroid, black holes, etc) we will go extinct as a species, even if 99% of humans die that still leaves A LOT OF PEOPLE. But there are a million possible diversions, from technological solutions to global warming (heat sinks, clean energy, living in the ocean) to space exploration to asteroid mining to things we can't even dream of. The true heroes of the future will be the ones who figure out solutions that make life best for as many people as possible, as heroes have done in the past, and not the ones who constantly predict we are doomed or think that restructuring society is the only option.
I mean hell even Thanos had a solution, global warming would disappear tomorrow if 50% of the humans vanished. Thats a horrific solution, and one that something like an AI or even nation-state may decide is the "best" solution for the most people, in the future.