Life Cycle of a Star
Stars are formed in clouds of gas and dust, known as nebulae. Nuclear reactions at the centre (or core) of stars provides enough energy to make them shine brightly for many years. The exact lifetime of a star depends very much on its size. Very large, massive stars burn their fuel much faster than smaller stars and may only last a few hundred thousand years. Smaller stars, however, will last for several billion years, because they burn their fuel much more slowly.
Eventually, however, the hydrogen fuel that powers the nuclear reactions within stars will begin to run out, and they will enter the final phases of their lifetime. Over time, they will expand, cool and change colour to become red giants. The path they follow beyond that depends on the mass of the star.
Small stars, like the Sun, will undergo a relatively peaceful and beautiful death that sees them pass through a planetary nebula phase to become a white dwarf, which eventually cools down over time and stops glowing to become a so-called "black dwarf". Massive stars, on the other hand, will experience a most energetic and violent end, which will see their remains scattered about the cosmos in a enormous explosion, called a supernova. Once the dust clears, the only thing remaining will be a very dense star known as a neutron star, these can often be rapidly spinning and are known as pulsars. If the star which explodes is especially large, it can even form a black hole.