The energy of the Sun comes from nuclear fusion in which hydrogen atoms combine to form helium and in the process release a tremendous amount of energy. Oddly, there is not enough pressure in the Sun to cause the fusion directly. If there were, most of the fusion would occur fairly rapidly as it does in more massive stars, instead of over the billions of years of our Sun's "main sequence".
The fusion in the Sun occurs because of a rare effect called "quantum tunneling". In this process, fusion takes several separate steps to form helium and release energy. During the process of making a helium atom, about 0.7% of the original hydrogen is converted from matter to energy.
In the Sun, even though quantum tunneling occurs extremely rarely to atoms, there are so many atoms that more than four million metric tons of hydrogen is converted to energy each second. Even at this rate, over the Sun's 4.57 billion year lifetime, only around 100 Earth-masses of matter have been converted into energy leaving about 332,900 Earth-masses remaining.
Quantum tunneling is so rare that far less energy is produced per kilogram of matter in the Sun than heat produced per kilogram in human bodies by chemical means. But the sun is extremely massive and the total energy production is immense.