Honey, let me tell you about the life cycle of an average star.
Firstly, all stars form from huge clouds of gas and dust.
Nuclear reactions at the center of a star provides energy which makes it shine brightly.
Eventually, the hydrogen which powers the nuclear reactions inside a star begins to run out. The star then enters the final phases of its lifetime.
A smaller star, like the Sun, will gradually cool down and stop glowing. During these changes it will go through the planetary nebula phase, and white dwarf phase.
A massive star experiences a much more energetic and violent end. It explodes as a supernova. This scatters the materials into space.