A star's life is a constant battle against gravity, the force that wants to compress it, and pressure support which is trying to hold it up. That battle begins as soon as a molecular cloud begins to collapse into a protostar.

During the main sequence lifetime, the star achieves stability by gas pressure (P=nkT); the collapse of the star is prevented because if the star were to compress slightly, it would get hotter and the rate of nuclear fusion would increase, causing it to expand again.

But what happens when the hydrogen in the core is used up? The core must resume its original collapse. In the process of collapsing the core heats up: it converts gravitational energy into heat energy, sort of like a hydroelectric dam converts the gravitational energy of a waterfall into electricity. Because this heat it transferred to the outer layers of the star, the core can't use that heat to maintain pressure support: it's like a leaky hot air balloon, slowly sinking. Meanwhile, that heat which is released to the outer layers has two important consequences:
Okay, well all this time the core continues to collapse and heat up, until finally it becomes hot enough to fuse helium into carbon by a reaction called the triple alpha process. Carbon can also fuse with helium to form oxygen. At this stage, the contraction of the core stops: the star has a helium-burning core surrounded by a hydrogen-burning shell. Eventually, of course, even the helium in the core becomes exhausted--this happens after only about 100 million years because helium burning is less efficient than hydrogen burning. Now the core is mostly carbon and oxygen (C-O) and once again continues its collapse. The star produces energy by burning helium in a shell around the core and hydrogen in a shell around that shell.
Start:Stars
