Here's a breakdown:
* Red Giant Phase: As the Sun runs out of hydrogen fuel in its core, it starts fusing helium, causing it to swell into a red giant. This expansion will engulf the inner planets, including Earth.
* Helium Fusion and Instability: The Sun will then fuse helium into carbon and oxygen. This process is unstable and causes the Sun to pulsate, eventually ejecting its outer layers.
* Planetary Nebula: These ejected layers form a glowing cloud of gas and dust, called a planetary nebula. The name is a bit misleading, as it has nothing to do with planets. It was given by early astronomers who observed these objects through telescopes and thought they resembled planets.
* White Dwarf: The remaining core of the Sun will become a white dwarf, a dense, hot, and incredibly small star. This white dwarf will slowly cool down over billions of years, eventually fading away completely.
So, the Sun's death will be a spectacular event, resulting in a beautiful and fleeting planetary nebula.