Stars spend most of their lives in the relatively unexciting main-sequence evolutionary phase, during which they casually convert hydrogen into helium in their cores via nuclear fusion. Our sun is in this phase. According to basic stellar theory, stars more massive than the sun shine more brightly and burn their fuel more quickly. A star 20 times as massive as the sun can keep going for only a thousandth as long.
As the hydrogen in the core of a star runs out, the core contracts, heats up and starts to fuse heavier elements, such as helium, oxygen and carbon. The star thus evolves into a giant and then, if sufficiently massive, a supergiant star. If the initial mass of the star is at least eight times that of the sun, the star successively fuses heavier and heavier elements in its interior until it produces iron. Iron fusion does not release energy--