A star becomes a red giant when its internal fuel supply of hydrogen starts to deplete, causing its core to collapse. Hydrogen continues to burn in its expanding outer layers at a cooler temperature, giving it a red color compared to other stars.
As the star's core collapses, it rises in temperature, pushing the outer layers to 100 times or more of its normal radius. When fusion in the core stops, the star shrinks and forms a new core of helium. When this core ignites, the outer layers of gas and dust are blown off and form a planetary nebula. Smaller stars continue to collapse and become white or black dwarf stars.