Here's a breakdown:
* Main Sequence: This is the longest and most stable phase of a star's life. During this phase, the star fuses hydrogen into helium in its core, generating energy that creates outward pressure balancing the inward pull of gravity.
* Hydrogen Depletion: As a star ages, it gradually consumes the hydrogen in its core. Once the hydrogen runs out, nuclear fusion in the core stops. This is a pivotal moment.
* Leaving the Main Sequence: Without the outward pressure from fusion, gravity takes over. The core contracts and heats up, eventually igniting hydrogen fusion in a shell around the core. This causes the star to expand and become a red giant or supergiant.
The specific evolutionary path a star takes after leaving the main sequence depends on its initial mass. For example, low-mass stars become red giants, while high-mass stars become supergiants.