A star’s whole life is decided mainly by one number: how much mass it is born with. Heavy stars burn hot and bright and die within a few million years in explosions. Light stars burn slowly and can outlast the present age of the universe many times over.
Updated
Born in clouds of gas
Stars form in cold, dark clouds of gas and dust, mostly hydrogen. When part of a cloud becomes dense enough, perhaps squeezed by a passing shock wave from a supernova, it starts to collapse under its own gravity. It breaks into clumps, and each clump heats up as it shrinks, becoming a protostar surrounded by a spinning disk of gas, in which planets may later form.
When the centre reaches about 10 million °C, hydrogen nuclei start fusing into helium, releasing energy that stops the collapse. A star is born. Clumps lighter than about 8% of the Sun’s mass, about 80 times Jupiter’s, never get hot enough; they become brown dwarfs, which glow faintly and cool for ever. The Orion Nebula, in Orion, is the nearest large star-forming region, about 1,340 light-years away.
The long middle: the main sequence
For about 90% of its life a star fuses hydrogen in its core. Astronomers call this stage the main sequence. How long it lasts depends sharply on mass:
No red dwarf has ever run out of fuel: the universe, at 13.8 billion years, is not yet old enough.
Stars like the Sun: a gentle end
When a star like the Sun uses up the hydrogen in its core, the core shrinks and heats while the outer layers swell enormously. The star becomes a red giant, like Aldebaran. The Sun will do this in about 5 billion years, growing large enough to swallow Mercury and Venus and perhaps Earth.
The red giant later blows its outer layers off into space, where they glow for a few tens of thousands of years as a planetary nebula, such as the Ring Nebula in Lyra. The name is a historical mistake; they have nothing to do with planets. What remains is the core: a white dwarf, about the size of Earth but with roughly the Sun’s mass. A teaspoon of it would weigh several tonnes. Sirius B is the nearest example. White dwarfs slowly cool and fade over trillions of years.
Heavy stars: supernovae
Stars born with more than about 8 times the Sun’s mass go further. After hydrogen and helium, they fuse carbon, neon, oxygen and silicon, each stage shorter than the last, until the core is iron. Fusing iron releases no energy, so nothing holds the core up. In less than a second it collapses, and the star’s outer layers rebound in a supernova that can outshine a whole galaxy for weeks. Betelgeuse and Antares will end this way.
The collapsed core becomes a neutron star: more massive than the Sun, packed into a ball about 20 km across. A teaspoon of it would weigh about a billion tonnes. Some spin rapidly and sweep beams of radio waves across space; Jocelyn Bell Burnell discovered the first of these pulsars in 1967. If the core is heavy enough, nothing can stop the collapse, and it becomes a black hole such as Cygnus X-1.
We are made of it
The Big Bang made almost only hydrogen and helium. Nearly all the carbon in your cells and the oxygen you breathe was made inside stars and scattered when they died. Many of the heaviest elements, including much of the gold and platinum on Earth, are thought to come from collisions between neutron stars. In 2017 gravitational-wave detectors caught two neutron stars merging, named GW170817, and telescopes saw the glow of freshly made heavy elements in the wreckage.