Stars live and die.
Stars are born in the gravitational collapse of dust clouds is space. As the material is packed together in the collapse, the temperature at the center increases until fusion reactions start, converting hydrogen into helium in the process. The energy from these reactions creates a pressure that counteracts the force of gravity and stabilizes the star. A star like the sun, which is in this ‘hydrogen burning’ phase, is said to be on the main sequence.
Once the hydrogen in the core is used up, the collapse starts again. It continues until the temperature gets high enough to start fusion reactions that convert helium to carbon. For stars up to about 5 times as massive as the sun, the temperature never gets high enough for further fusion reactions, and when the fuel is used up the collapse starts again. It keeps going until the electrons can’t be pushed together any more—this will happen when the sun is the size of the Earth, for example. At this point the star is a white dwarf, a cooling cinder in space.
The sun was formed about 4.5 billion years ago, and will become a white dwarf in another 5.5. billion years.
Stars more massive than the sun continue the fusion process, ‘burning’ carbon and forming silicon, magnesium, and other heavy elements, until it starts to make iron. No energy can be obtained from fusing iron, so the iron builds up in the core. Eventually, nuclear reactions convert the protons in the iron nuclei to neutrons, and the core collapses, triggering a massive explosion known as a supernova. The debris from the supernova is blown back into space, where it is incorporated into new generations of stars.
After a supernova event, the neutron core forms a neutron star a few miles across. For very massive stars, the collapse continues until a black hole is formed.