The Sun, just like all other stars, has a fascinating life cycle that spans billions of years. It all began about 4.6 billion years ago from a vast, swirling cloud of gas and dust called the solar nebula. The nebula collapsed under its own gravity, with the majority of the material forming the Sun at the center, while the rest coalesced into a rotating disk that gave birth to the planets and other objects in our solar system. As the Sun's core grew denser and hotter, nuclear fusion ignited, marking the beginning of its main sequence phase.
Currently, the Sun is in the main sequence phase, steadily converting hydrogen into helium within its core. This is the longest and most stable period of a star's life. Although it may seem counterintuitive, the Sun's energy output gradually increases during this phase. In fact, it is estimated to be about 40% brighter now than when it first formed.
However, in about 5 billion years, the Sun will exhaust its hydrogen fuel. As a result, the core will contract, while the outer layers expand and cool, transforming the Sun into a red giant. This expansion will be so immense that it will engulf Mercury and Venus, and possibly even Earth. The intensified solar radiation will make Earth uninhabitable long before it is engulfed by the expanding Sun.
As the core contracts further, it will become hot enough to ignite helium fusion, converting helium into carbon and oxygen. This process will temporarily halt the Sun's expansion. However, the helium will eventually be depleted, leading to another core contraction. This time, the outer layers will be ejected into space, forming a spectacular planetary nebula.
The remaining core of the Sun will then become a hot, dense object called a white dwarf. This white dwarf will slowly cool and fade over trillions of years, eventually becoming a cold, dark object known as a black dwarf. It's important to note that this entire process is gradual and takes place over billions of years, not suddenly or overnight.