Here's a breakdown:
1. Main Sequence: Stars spend the majority of their lives in the main sequence, fusing hydrogen into helium in their core.
2. Red Giant: Once the hydrogen fuel in the core is depleted, the star expands and cools, becoming a red giant. The star starts fusing helium into heavier elements in a shell around the core.
3. Planetary Nebula: Eventually, the outer layers of the red giant are ejected into space, forming a planetary nebula. This leaves behind the hot, dense core of the star.
4. White Dwarf: The remaining core, now extremely dense, is called a white dwarf. It is mostly composed of carbon and oxygen and is supported by electron degeneracy pressure, which prevents it from collapsing further.
Important note: This process only applies to stars with masses less than about 8 times the mass of our Sun. More massive stars undergo supernova explosions instead.