How do stars form, and what happens when they die?
Stars form when gravity overcomes pressure in a cloud of gas and dust, and they die when they run out of fuel to resist gravity with. The entire life of a star is a standoff between those two forces, and its mass decides how the standoff ends.
Formation. Cold molecular clouds — mostly hydrogen, extremely diffuse — collapse under their own gravity, usually triggered by a shockwave from a nearby supernova or a collision. As material falls inward it heats up, and when the core reaches roughly 10 million kelvin, hydrogen fusion begins. The outward pressure from fusion halts the collapse, and the star enters equilibrium.
The long stable phase. Most of a star's life is spent fusing hydrogen into helium. Our Sun has done this for about 4.6 billion years and will continue for roughly another 5 billion.
Crucially, more massive stars burn out faster. Greater mass means greater gravity, higher core temperature and far faster fusion — a star ten times the Sun's mass lives a tiny fraction as long. The most massive stars last only millions of years.
How it ends, by mass:
Low mass stars fuse so slowly that none has yet died in the universe's lifetime.
Sun-like stars exhaust core hydrogen, swell into a red giant, fuse helium into carbon, then shed their outer layers as a planetary nebula, leaving a white dwarf — an Earth-sized ember supported not by fusion but by quantum pressure, cooling for trillions of years.
Massive stars fuse progressively heavier elements in shells — carbon, oxygen, silicon — each stage faster than the last, until they reach iron. Fusing iron consumes energy rather than releasing it, so the core collapses in under a second, and the rebound produces a supernova.
What remains is a neutron star or, above a threshold, a black hole.
Why this matters to you. Elements heavier than hydrogen and helium were made inside stars and scattered by their deaths. The carbon, oxygen, calcium and iron in your body were made in stellar cores, which is the literal sense in which the phrase is true.