Explanation:
Sun is composed of plasma and hot gases . Due to the dynamo process , the magnetic field of the sun is generated .
The energy of sun is originated from the thermonuclear fusion reaction , that occurs on the surface of the sun .
Since , sun has a very strong gravity , hence the atoms of hydrogen fuse to form helium .
The reaction , i.e. , nuclear fusion , when the hydrogen atom converts to the atom of helium , the by product of this reaction is huge amount of energy , which is responsible for the energy source on the sun .