Answer:
Most main sequence stars, including sun, produce heat and light by smashing atoms together to create explosions. Eventually, when the atoms continue to combine, they become too big to combine, and the star dies out. Then, it kind of implodes, and the friction of it becoming too dense makes it expand greatly past its original size, only temporarily. Shortly after, it finally explodes.