how energy production occurs within the sun
Energy is not a physical unit. It is a philosophical concept and an accounting technique used to analyze mechanical and chemical exchanges. In nuclear physics it is defined as a wavelength of light, in biology it is a synonym for metabolism, and in public utilities they say energy when they mean connectivity. Anybody who uses the word in any other context either does not know what he is talking about, or is peddling something you don't need.
There are two theories about the source of power for the sun. One is fusion of hydrogen to helium. That implies that the inside is hotter than the outside, and the reverse is seen to be true. The other is charged particles making gases shine just like a neon light. The source of the particles is unknown.