Energy in the Sun is produced by fusion of protons, note that this kind of fusion is not possible under any other condition except extremely high pressure and temperature so that protons can overcome high repulsion to fuse together to release energy, these conditions are possible at the core of the Sun