Initially there are lots of hydrogen atoms and trace elements in the Sun. Despite insufficient energy for the hydrogen to fuse in the core, quantum tunneling saved the day and invoke proton-proton chain reaction to release partial of Sun total energy output. What about the byproduct helium which require almost as much as ten times the temperature required to overcome the coulomb barrier right? What is exactly happening in the core once the hydrogen runs out in approximately 5 billion years from now?
Here is what will happen.
For a so-called main sequence star, that helium just builds up in the star because the star's gravity holds it there. Once the hydrogen supply runs out, the weight of all that helium squeezes down on the core and if the squeeze is hard enough, the temperature down there will get high enough to activate helium fusion, and the star shifts to burning helium and stays hot. If the squeeze isn't enough, the fusion process stops and the star cools off and shrinks.