STEP-BY-STEP ANSWER:
Step 1: Begin with a star on the zero-age main sequence where hydrogen fusion in the core produces helium.
Step 2: As hydrogen in the core is depleted, the balance between the gravitational collapse and thermal pressure is disrupted.
Step 3: The decrease in core pressure leads to contraction of the core and an increase in temperature and density.
Step 4: The star's outer layers expand due to increased energy release from surrounding hydrogen shell fusion, transitioning the star into the red giant phase.
Step 5: For stars of higher mass, additional fusion processes may occur, further influencing evolutionary steps beyond the red giant stage.
Final Answer: A star evolves from the main sequence to the red giant stage as its core runs out of hydrogen, contracts, and heats up, causing the outer layers to expand and cool, and this process is influenced by the star’s mass and the subsequent changes in core composition.