We will be dead long before the sun explodes; as the sun runs out fuel, it grows hotter, it's gravitational pull becomes greater, and our planet gradually becomes hotter and hotter until it can no longer sustain life.
Then the sun explodes. But only after we're sufficiently fried and dead. We might get clever about it and find a way to survive. If we do, then we die consumed by a red giant.
If we manage to die before then, then it would be from an enormous asteroid.
If before then, a deadly virus.
Uh. I think it's unlikely that robots will kill everyone and everything will die and explode because of it.
Although I'm talking about humanity. If we actually mean the world, then it's red giant or asteroid.
Last edited by Acavado; Oct 31, 2011 at 09:49 PM.