Here's a simplified explanation:
1. Hydrogen nuclei (protons) collide: Under immense pressure and heat in the Sun's core, hydrogen nuclei collide with incredible force.
2. Fusion occurs: Some of these collisions have enough energy to overcome the electrostatic repulsion between the protons, allowing them to fuse together.
3. Helium is formed: Two protons fuse to form a deuterium nucleus (one proton and one neutron). This deuterium then fuses with another proton to create a helium-3 nucleus (two protons and one neutron). Finally, two helium-3 nuclei combine to form a helium-4 nucleus (two protons and two neutrons).
In addition to helium, the fusion process in the Sun also produces a tremendous amount of energy, which is released as light and heat. This energy is what powers the Sun and, ultimately, our planet.
While helium is the primary product, other heavier elements can be formed through subsequent fusion reactions involving helium and other heavier elements. However, this process is less prevalent compared to the primary hydrogen-to-helium fusion.