What happens after Sun burns all of its Helium to Carbon in its RedGiant state?
The Sun's core will shrink, begin to cool, and the outer layers will be shed to briefly form a Planetary Nebula.
After sun burns all of its Helium to Carbon in its red giant phase, the core will collapse. The outer layers will be ejected. While they are close enough to the central star, these layers will form a planetary nebula. The planetary nebula phase of stellar evolution is a very brief period in the life of the star lasting just 10,000 years. For a star the size of our sun, the core will continue to cool and become a white dwarf as the outer layers drift off into space.
Larger stars can do other things. Some are massive enough to begin burning their carbon. Some will explode into supernovae and may form black holes. Still others will form very dense neutron stars.