I agree with Pcbpage:
A pandemic virus would be the most credible cause, though another plausible reality would be a sudden rising of the oceans that enveloped all of humanity or a deadly shower of comets.
Some philosophers in the ancient world believed that the earth had a conscious system and would know when it is ready to expire, though more commonly, the vast majority of humanity are conventionally religious and believe that the invention of God will play his part in ending it all. Most eastern cultures though, are of the same opinion as the ancient philosophers and so according to them, it is how we treat the earth that matters as to the outcome of human existence in the immediate and long term future.
My personal belief is that there will be a culmination of different natural events. Just because the earth has been around for some billions of years, does not guarantee anything and galaxies are exploding all the time, so why should ours be any different?
We are more likely to get struck by an asteroid than a nuclear war outbreak when weapons are expensive commodities and humanity has proved that they can survive even these kinds of attacks because poulation growth is far too large in the modern world to be that easily eradicated en-masse.