well, there are two processes basically, fusion and fission
and in sun fusion takes place in sun core where helium molecules fused together to form hydrogen.
The hydrogen and helium in the Sun were produced by Big Bang nucleosynthesis, and the heavier elements were produced by stellar nucleosynthesis
hope it helped :)