The star continued to shine till the exhaustion of hydrogen gas. When the hydrogen gas got consumed completely, the helium was left as the product of reaction. Since the nuclear reactions had stopped, the gravity started dominating the outward energy pressure and the star started collapsing which increased pressure and temperature. With the rise in the temperature, the helium started participating in nuclear reactions to form carbon. When Helium got finished, the carbon started fusion reaction to form heavier elements like oxygen and silicon. These chain reactions continued till the formation of iron. The iron is most stable element. After the iron no further nuclear reaction took place in the star and after this, the star stopped shining.