When the star has run out of hydrogen fuel to fuse into helium within its core the core will begin to collapse and heat some more. To counter the core's collapse the outer envelope expands causing the temperature to drop at the surface but also increasing surface area and thereby the luminosity of the star. Within the core temperatures will rise to begin fusion of helium into carbon. A shell around the core will rise to such a temperature as to ignite further hydrogen fusion in that region of the star. The helium produced falls onto the core where it can be used as fuel. This time in the life of a Red Giant is very short compared to the main sequence lifetime, only a few million years.