the world will end before the sun dies at the rate we're going environmentally. i'm guessing erratic weather will eventually get bad enough to cause enough droughts and disasters to mess with most most of the world's food supply.
But the earth as a physical body will still exist. You're talking about life, I'm talking about earth.
The Sun will become a red giant in ~5 bil years, engulfing Mercury and Venus and diminishing any life on Earth, provided we haven't killed ourselves yet
Humans will be killed off by the next 50-200k years.
Human beings haven't even existed 50k years, and we're already destroying our planet.
The humans**** (not the earth) will eventually die of starvation.
We're cutting down all our oxygen. At the same time, we consume more meat in a single week than what a regular person would in a single year during the 1950's. The planet does not contain enough meat to feed 15 billion people. Veganism could however feed that many people.
On another note, the earth itself won't be ending for an extreme long amount of time, however life on earth will end because it's been happening for millions of years, over and over due to natural disasters.
For all we know the earth might get hit by something in space and a lot of times that's not something we can predict. In the past we didn't see objects until they were extremely close to earth because the object was dark and didn't reflect sunlight. If a huge meteor were to hit us, the earth would turn into a giant red ball of flames.