Disclaimer: This is my opinion, not advised by anybody, feel free to comment below.
There are two problems that we as humans will have to face. I will write about the two that I think are crucial and only now people start to appreciate them.
The first problem is Global warming. It poses a lot of threats not only to fragile ecosystems but to whole Earth. Some of the effects listed from Wikipedia are: extreme weather, sea level rise, ocean acidification, changes in agriculture, environmental migration and much, much more .
Global warming is the first problem that we need to address but in this post, I will concentrate on the next issue on the list. Humanity will eventually die out if we are not able to spread in the Universe .
First, we could of course ask the question when we should colonize other planets or even if it is good idea. Let’s take a scenario, when humanity successfully colonizes Mars and at the same time Earth is becoming more inhabitable. At some point, we simply leave it behind, maybe let it rejuvenate without ever learning how to live in a way that does not cause rest of life extinct. What would continue? Maybe we will be able to spread out in the rest of the Solar System and eventually leave it behind. In what state though? And does it even matter if Mars which is right now mostly empty wasteland suffers any damage if it is even possible? Maybe we would change into species that travels the Universe and leaves dead rocks behind? What if we encountered other life out there, would them await the same fate as Earth? We are authors of our own morality and clearly there does not seem to be objective one. Our values change, we are starting to really appreciate our surroundings, the question is, are we fast enough?
Note: I am aware that there are different things that could happen. I took time today to write shortly out what I thought about one of them.
 There are also problems not related to Global warming but are as well very global, for example what are we going to do with plastic.
 See also, gamma ray bursts, solar eruptions (big problem but probably no immediate deaths), huge asteroid collisions and other things that would wipe us out.