Stars are formed from dense nebulae that contract under gravity. They shine by nuclear fusion of hydrogen into helium. Small stars with about one solar mass spend 10 billion years fusing hydrogen, then shed their outer layers and leave behind a cooling white dwarf remnant. More massive stars over 10 solar masses also fuse hydrogen but rapidly become red supergiants and end in supernova explosions, with their cores potentially surviving as neutron stars or black holes.