Mass as the dominant factor in stellar destiny
A star's entire evolutionary path is set by its mass at birth. Low-mass stars (less than about 0.5 solar masses) burn hydrogen so slowly that their main-sequence phase lasts over 100 billion years, longer than the current age of the universe. They never leave the main sequence in any timescale relevant to astronomy. Intermediate-mass stars like the sun have main-sequence lifetimes of roughly 10 billion years. High-mass stars (over 20 solar masses) exhaust their fuel in just a few million years. This means the massive stars we see in the night sky today have lives measured in mere moments cosmically speaking, while the dim red dwarfs burning slowly in the distance might still be fusing hydrogen when the sun has long since died.
Low-mass end state: white dwarfs
When a low-mass star like the sun exhausts its core hydrogen, it swells into a red giant, fusing hydrogen in a shell around the inert core. After about a billion years as a red giant, it sheds its outer layers, and the exposed carbon-oxygen core becomes a white dwarf. This remnant no longer fuses; it simply cools, taking hundreds of billions of years to become a cold, dark object. The sun will eventually create a planetary nebula visible for thousands of years before fading into obscurity as a white dwarf.
High-mass end state: neutron stars and black holes
Massive stars end differently. After using up hydrogen, they fuse helium, then carbon, neon, magnesium, silicon, and iron in progressively faster shells. Iron fusion is the final stage because fusing iron consumes energy rather than releasing it. When the core reaches iron and can no longer support fusion, the entire core catastrophically collapses in less than a second, rebound violently, and explodes as a supernova. The resulting remnant is either a neutron star (for progenitors roughly 8 to 20 solar masses) or a black hole (for more massive progenitors). The neutron star or black hole becomes the eternal corpse of the original massive star, orbiting at the center of the expanding supernova remnant.