For a sun like star, when hydrogen fuel becomes depleted, fusion stops in the core. So, we no longer have the nuclear explosions which keeps the star from collapsing due to gravity. So, it starts to contract.
Due to contraction, pressure and temperature both increases. At some point temperature...