The life cycle of a star begins in a **nebula**, a cloud of gas and dust. Gravity pulls the material together to form a **protostar**, which heats up as it contracts. When the core temperature becomes hot enough, **nuclear fusion** ignites, converting hydrogen into helium, and the star enters the **main sequence**, the longest phase of its life. When the hydrogen is depleted, the star expands into a **red giant**. Low-mass stars shed their outer layers, leaving behind a **white dwarf**, while massive stars explode in a **supernova**, potentially forming a **neutron star** or a **black hole**.