In fusion light nuclei join to make a heavier nucleus and release energy. Nuclei are positive and repel, so fusion needs a very high temperature, to make them move fast enough, and a high density, so that they collide often. Main-sequence stars fuse hydrogen into helium in the core.
A star is stable when the inward pull of gravity balances the outward pressure of radiation and hot gas.
The Hertzsprung–Russell diagram plots luminosity against surface temperature, with temperature increasing to the left. Most stars lie on the main sequence. Red giants are at the upper right and white dwarfs at the lower left. The mass of a star decides how it ends.