Stars are big balls of mostly hydrogen and
helium, the two most abundant elements in the
UNIVERSE. Now because stars are so massive,
more massive than you are, the PRESSURE at the
center of the star is very very compressed... and
when a gas gets compressed it heats up because
the atoms are closer together and potential
energy is smaller, but the kinetic energy, a
direct measure of temperature is higher. The
temperature in the core of the sun is about 15
million degrees!!! Pretty hot!
Now, at these high temperatures, then two
atoms of hydrogen slam into each other, the
protons stick and a new element is made . . . it
is called helium. In that NUCLEAR process a
huge amount of energy is generated and the energy
is carried to us as sunlight! This is the same
reaction that powers a nuclear hydrogen bomb.
The conversion of hydrogen H to helium He, plus
lots of energy.