The evolution cycles of Sun-like, high-mass, and low-mass stars all vary greatly, but here are the main points to remember. At the end of a Sun-like star’s life, it will have fused hydrogen into helium and then helium into carbon and oxygen at its core. The star expands briefly, pulsates, contracts, and puffs its outer layers into space. What’s left is the dense core — called a white dwarf — whose energy causes those gas layers to glow, creating a beautiful planetary nebula.
High-mass stars create even more elements through fusion, such as neon, magnesium, silicon, nickel, and iron. Iron is the end-of-the-road, so the core begins to collapse under gravity and then heats up and bounces back. The star explodes as a supernova, which releases a tremendous amount of energy. After the light fades, the star’s core is a neutron star or a black hole (the two densest objects known in the unverse), and the layers of gas surrounding it may glow for thousands of years as a supernova remnant.
Low-mass stars continue to fuse hydrogen into helium until nearly the entire star is helium. Theory says that the star then shrinks, cools, and fades away. However, the universe isn’t old enough to know for sure.