After exhausting core hydrogen, stars evolve off the main sequence along different paths determined primarily by mass. Low-mass stars become red giants with inert helium cores and hydrogen-burning shells; very low-mass stars eventually become white dwarfs. Intermediate-mass stars progress through helium burning and produce planetary nebulae. Massive stars burn progressively heavier elements (C, O, Si) in the core before core collapse. The timescale dramatically decreases with each burning stage.
From your study of core hydrogen burning, you know that a main-sequence star is fundamentally a machine converting hydrogen into helium in its core, sustained by the balance between gravity pulling inward and thermal pressure pushing outward. Post-main-sequence evolution begins when that fuel runs out. What happens next depends almost entirely on one number: the star's initial mass.
For a low-mass star like the Sun (roughly 0.8–2 solar masses), the exhaustion of core hydrogen leaves behind an inert helium core that is too cool to ignite helium fusion. But hydrogen still burns in a thin shell surrounding the core, and the energy output from this shell actually increases. The core contracts under gravity, heating the shell, which burns faster and drives the outer envelope to expand enormously. The star becomes a red giant — hundreds of times its main-sequence radius, with a cool red surface but a dense, hot core. Eventually the core reaches ~100 million K and helium ignites in a dramatic event called the helium flash (in stars below ~2 solar masses). After a period of stable helium core burning on the horizontal branch, the star exhausts its helium, develops a carbon-oxygen core, and sheds its outer layers as a planetary nebula, leaving behind a white dwarf — a dense remnant supported not by fusion but by electron degeneracy pressure.
Intermediate-mass stars (roughly 2–8 solar masses) follow a similar trajectory but with key differences: helium ignition is gentler (no flash) because the core is less degenerate, and these stars can undergo thermal pulses on the asymptotic giant branch where helium and hydrogen shells alternate in burning. They produce heavier elements through nucleosynthesis and enrich the interstellar medium when their envelopes are ejected. Their remnants are also white dwarfs, but with higher masses — close to the Chandrasekhar limit of ~1.4 solar masses.
Massive stars (above ~8 solar masses) take a dramatically different path. Their cores are hot and dense enough to burn helium smoothly after hydrogen exhaustion, and then to ignite carbon, neon, oxygen, and silicon in succession. Each stage is shorter than the last: carbon burning lasts centuries, oxygen burning months, and silicon burning just days. The star develops an onion-like structure with concentric shells of different burning stages. When the core finally converts to iron, fusion can no longer release energy — iron has the highest binding energy per nucleon. The core collapses in milliseconds, producing either a neutron star or a black hole, and the outer layers are blasted away in a core-collapse supernova. This explosion seeds the interstellar medium with heavy elements, closing the cycle of stellar nucleosynthesis that builds the periodic table.