Born from a cloud
Between the stars, space is not quite empty. Vast cold clouds of gas, mostly hydrogen, drift through it, and now and then a part of one begins to fall inward under its own gravity. As it shrinks it heats, and when the centre reaches about ten million degrees, hydrogen nuclei begin to fuse into helium. The collapse stops; the glow begins. A star has switched on.
How much gas gathers in that collapse is the single most important fact about the star. It sets its colour, its brightness, how long it will live and how it will die.
The long middle
A star spends most of its life doing one thing: fusing hydrogen into helium in its core, and using the energy released to hold itself up against its own gravity. Astronomers call this stretch the main sequence. The Sun is in it now, and has been for four and a half billion years, with roughly as long again to go.
Heavier stars have more fuel, but they burn it far faster, because the extra weight squeezes the core hotter. A star of ten solar masses shines thousands of times brighter than the Sun and is gone in a few tens of millions of years. A red dwarf of a third of the Sun’s mass sips its hydrogen so slowly that it will still be burning in a trillion years, long after every heavier star that exists today has died.
Try it: choose Red dwarf and scrub to the end. Then choose Giant and do the same.
Running out
When the core’s hydrogen is spent, the balance breaks. The core shrinks and heats, fusion moves into a shell around it, and the outer layers swell enormously and cool. The star becomes a red giant, dim red at the surface but huge. When the Sun reaches this stage it will swallow Mercury and Venus and fill the sky over Earth.
Three endings
What happens next depends on the mass.
A Sun-like star cannot get hot enough to fuse beyond carbon and oxygen. Its outer layers drift away as a glowing shell called a planetary nebula, and the core is left behind as a white dwarf: a hot ember about the size of the Earth, slowly cooling for billions of years.
A massive star, eight Suns or more, keeps fusing heavier elements until it makes iron, which yields no energy at all. The core collapses in a fraction of a second and the star blows itself apart in a supernova, briefly outshining its whole galaxy. What remains is a neutron star, a city-sized sphere so dense that a spoonful weighs a billion tonnes, or, for the very heaviest stars, a black hole, a region whose gravity nothing can climb out of.
A red dwarf gets neither ending. It burns steadily, and will simply fade, but not for a length of time the universe has yet existed.
Made of star stuff
Almost every element heavier than hydrogen and helium was made inside a star, and the heaviest were made in the last seconds of a supernova. Those explosions scattered the elements into the clouds that formed the next generation of stars, and their planets. The carbon in your cells and the iron in your blood were forged this way, in a star that died before the Sun was born.