When a star runs out of hydrogen, it swells into a giant. The most massive stars end in a supernova explosion.
When a star runs out of hydrogen in its core, the core contracts and heats up, while the outer layers swell and cool. The star becomes a red giant. In about 5 billion years the Sun will become a red giant large enough to swallow Mercury and Venus.
Supernovae
Stars with more than about eight times the mass of the Sun end their lives in a giant explosion, a supernova. For a few weeks a single supernova can outshine an entire galaxy.
Supernovae spread the elements made inside stars, such as carbon, oxygen and iron, into space. These elements later become part of new stars, planets and living things. The iron in your blood was made in stars that died long before the Sun was born.
The Crab Nebula
The Crab Nebula in the image above is the remnant of a supernova that was seen from Earth in the year 1054. Chinese astronomers recorded that it was visible in daylight for several weeks.