The life cycle of a star begins in a nebula, a cloud of gas and dust, where gravity causes the material to collapse and heat up. When temperatures rise enough, nuclear fusion begins, marking the birth of a star. The star then spends most of its life in a stable phase, fusing hydrogen into helium in its core, a process that powers the star and keeps it shining.
Eventually, the star runs out of hydrogen, and its core contracts, causing the star to expand into a red giant or supergiant. Depending on its mass, the star will end its life in a spectacular supernova explosion, leaving behind either a white dwarf, a neutron star, or a black hole.