In a main sequence star the gravity of the core is balanced by the outward pressure of the heat created by fusion of hydrogen atoms, maing it stable. So when the hydrogen is used up, does the star expand to form a red giant because the outward pressure?
When a star's core fuses all of its hydrogen into helium, the core contracts. The temperature and intense pressure caused by the contractions causes helium to begin fusion in the core. This takes pressure the place of outward pressure previously caused by hydrogen fusion, but is much more energetic. Therefore, the hydrogen shell outside the core expands outward. Since the surface of the star is now much larger than it was, it burns cooler causing the red color.