M57: The Ring Nebula; Credit: H. Bond et al., Hubble Heritage Team (STScI / AURA), NASA
When a star exhausts its fuel, strange things can happen. A star like our sun will burn hydrogen into helium for ten billion years. When the hydrogen in the core is exhausted, the stars will then burn helium into carbon, oxygen, neon, and magnesium. When helium and heavier elements are burned, the core of the star is much hotter than it is in our sun. The light that is produced actually pushes away the outer layers of the star. The star swells up to become a red giant for a few hundred thousand years. At the end of this phase, the light from the central core will be so intense that the outer layers of the star will be blown off into space. The matter flowing off into space is illuminated by the hot cinder that used to be the core of the star. This produces a planetary nebula (inappropriately named, because they have nothing to do with planets; they simply looked like planets that didn't move in early telescopes).
About half of a star gets returned to space during its phases as a red giant and a planetary nebula. The material is mostly from the outer layers of the star, so it has not been processed much (unlike the material ejected by a supernova). Many planetary nebula appear spherical like the one above, but equally many have strange shapes of uncertain origin.
After the planetary nebula fades, what remains of the core of the star, a white dwarf, will slowly cool. The cinder left behind is no longer held up by the energy of fusion, but by the repulsive quantum mechanical forces that operate between electrons in atoms. Eventually, the white dwarf becomes a massive crystal that is the diameter of the earth, and that could be similar to the mass of the sun. This will be the fate of our own sun in 5 or 10 billion years.
