The sun will definitely die out. All stars have a finite lifetime - this lifetime is usually pretty long relative to our lifetime or even the age of the earth, but all stars will eventually die out. The way they go about their death depends heavily on how big they are.
The sun right now is a little over four and a half billion years old. For a star of its mass, this is middle age. It’s happily consuming the enormous mass of hydrogen in its core into helium, as it has been for the past few billion years, and as it will continue to do for the next few billion years. Perhaps not very surprisingly, the length of time any star will continue to sit and churn hydrogen into helium depends directly on how much hydrogen it has, and how quickly it’s running through the hydrogen.
Once the sun runs out of hydrogen in its core (there will still be plenty of hydrogen in the sun, but since the fusion reaction only occurs in the very center, it’s the center concentration of hydrogen that matters.), that’s when things start to get interesting. If there’s no more hydrogen to be converted into helium, then the pressure usually generated by the fusion reaction at the center of the star stops. No outwards pressing pressure means that the enormous mass of the sun will crush inwards upon itself, until the centre of the sun is so hot and dense that it can start burning helium into carbon and oxygen.Since we’ve also crushed the outer parts of the sun, we’ve now got a helium burning star, with a hydrogen burning shell around it. The sun will loosen its grip on the outer edges of the star, so they’ll start expanding and cooling down, which will the color of the sun from yellow to red. The surface of the sun will reach past the orbit of the earth, so at this point pretty much everything on the earth, and very likely the planet itself, is completely toast. Life on the planet would have died off well before the surface of the sun got anywhere near us.
If the star is massive enough, it can keep going through this process of “whoops, out of stuff to burn” -> “collapse more” -> “can burn a new element!” until the star is creating iron in its core. For the sun, helium will be the last element it can burn. When it exhausts the helium in its core, it will start to shrug off layers and layers of gas, until all that’s left of the star is the carbon-oxygen core, which will shine as a white dwarf, surrounded by a planetary nebula.
The expansion into red giant phase is another 4.5 billion years away, so we’ve got plenty of time to figure out where we’d rather be, assuming we’re still around as a species.
Sign up for the mailing list for updates & news straight to your inbox!