1. Nebula: The star begins its life as a cloud of gas and dust called a nebula. These nebulae are vast and cold, but they contain the raw materials needed to form stars. Over time, gravity pulls the material together, causing it to heat up and collapse.
2. Main Sequence: Once the core of the collapsing nebula becomes hot and dense enough, nuclear fusion begins. This is where hydrogen atoms fuse to form helium, releasing tremendous amounts of energy. This energy is what makes the star shine and creates the outward pressure that balances the inward pull of gravity, establishing a stable state called the main sequence. Most stars, including our Sun, spend the majority of their lives in this stage.
3. Red Giant: As the star ages, it begins to run out of hydrogen fuel in its core. This causes the core to contract, which in turn heats up the outer layers of the star, causing them to expand and cool. The star becomes a red giant, much larger and cooler than it was during its main sequence stage.
4. White Dwarf: Eventually, the red giant's outer layers are ejected, forming a planetary nebula. The core of the red giant collapses into a dense, hot object called a white dwarf. This object is about the size of Earth but contains the mass of the Sun. White dwarfs are very hot, but they have no source of energy, so they gradually cool down over billions of years.
Important Note: This is a simplified explanation of stellar evolution. The specific details of each stage can vary depending on the mass of the star. More massive stars evolve differently and have shorter lifespans than less massive stars.