The Sun is currently in its main sequence phase, fusing hydrogen into helium for about another 5 billion years. When this hydrogen is depleted, the Sun will undergo a significant transformation. Its core will contract and heat up, causing its outer layers to expand, potentially engulfing Mercury, Venus, and possibly Earth.
As the Sun evolves, it will start fusing helium into heavier elements like carbon and oxygen. This stage is short-lived, followed by an unstable period where the Sun sheds its outer layers into space through strong stellar winds. The resulting planetary nebula will be a colorful spectacle.
The remaining core, now exposed, will become extremely hot and dense, marking the onset of the white dwarf stage. Composed mostly of carbon and oxygen, this core will gradually cool and fade over trillions of years, eventually becoming a cold, dark “black dwarf” – though none exist yet due to the universe’s age.
Throughout this process, the Sun will lose about half its mass, drastically altering the solar system and ultimately ending life on Earth as we know it.
Source: https://www.indiatoday.in/visualstories/science/the-last-sunrise-how-the-sun-will-die-and-destroy-our-solar-system-247563-07-07-2025