Stars are born, live and die, and our Sun is in the middle of its life right now. When it dies, it will begin to swell and then expel its gaseous matter into space, until only a small, cold, dead star, known as a white dwarf, would remain.
Before the Sun collapses into a white dwarf, the temperature will significantly increase on Earth, so much that the oceans will begin to boil. Not even the most resistant microbes, which many scientists say will be the primary inhabitants of the planet by then, will survive.
Against all the odds, the last survivors will be the extremophilic microorganisms we know today living in places as inhospitable as the acidic Rio Tinto basin, or deep into the Mariana Trench.
The Sun will continue to rise in temperature, consuming its hydrogen reserves
The Sun is transforming hydrogen into helium all the time now, but, according to scientists, in 5 billion years, the Sun’s core will no longer contain any hydrogen, and then the pressure will decrease.
When the energy source is depleted, the gravitational collapse will begin in the Sun’s core and will be transmitted to the rest of the star’s layers which will still contain hydrogen but where nuclear fusion could not take place because the density and temperature were too low.
Then, in that chain reaction that is the death of a star, the layer of hydrogen that surrounds the nucleus collapses, it becomes denser and hotter and, as a new source of fuel is found, another nuclear fusion reaction is initiated and the Sun will seem to revive briefly, very luminous. The Sun will be a red giant at that time.
The Sun will become a white dwarf because it’s not massive enough to form a supernova
In the end, only a small but very compact residue will remain of the Sun, namely, a white, cold, dwarf star with no activity, like a stellar corpse abandoned in the middle of the Universe.
If it were about eight or ten times larger, the Sun would have a very different death. It would explode in the form of a spectacular supernova, but our star doesn’t have enough mass for that and will end its life cycle slowly fading out.
In short, if the Sun was formed about 4.65 billion years ago and will die within the next5 billion years, its total lifespan will be around 10 billion years, and it is now in the middle of its journey, consuming fuel at astronomical rates.