A star’s mass decides whether it fades as a white dwarf or collapses into a black hole.
Every star begins inside a huge cloud of gas and dust called a nebula. Gravity pulls parts of the cloud together. As the material becomes packed tightly, the centre grows hotter and a young star begins to form.
Gravity gathers gas into a dense clump called a protostar. The centre keeps heating until hydrogen nuclei begin to fuse into helium. This releases energy, and the new star enters its long, stable stage.
During the main sequence, hydrogen fusion pushes energy outward while gravity pulls inward. These effects balance. A star like the Sun can stay in this stage for billions of years, slowly using its hydrogen fuel.
When core hydrogen runs low, the star changes. A lower-mass star expands into a red giant, sheds its outer layers, and leaves a white dwarf. A much more massive star becomes a supergiant and can explode as a supernova.
A white dwarf is a hot, dense stellar core supported by tightly packed electrons. A black hole forms when a massive collapsed core is squeezed so strongly that not even light can escape its event horizon.
Stars do not all become black holes. The Sun will become a white dwarf, not a black hole. Also, a supernova can leave a neutron star instead. The star’s starting mass controls which ending is possible.