>>12194058hydrogen in core of star runs out and it begins to contract because there's no more fusion to support it, but then that contraction brings more hydrogen into region where fusion can happen and things get complicated but you end up with a shell of hydrogen fusion while the core inside continues to contract and that contraction generates a fuckton of heat that is absorbed by the outer layers of the star and it starts getting bigger
what happens next depends on the mass of the star, but the core continues to collapse until electron degeneracy pressure halts further contraction and it just starts getting hotter and hotter down there and expanding the outer layers until it gets hot enough to fuse helium down in the core, and then once the helium in the core runs out the same process happens again except now you have a helium fusion shell inside the hydrogen fusion shell
the helium fusion results in buildup of carbon and oxygen in the core and if the star is large enough to fuse that then the process just continues on with heavier and heavier elements until eventually it can't get hot enough to fuse the new products and then it starts cooling down and shrinking