Nuclear fusion is a way of producing energy by joining two light nuclei together to get one heavier nucleus. It is nuclear fusion that powers the stars!
This animation shows a simple example of such a fusion reaction where a deuterium nucleus joins one of tritium to make one nucleus of helium 5. This is unstable and so
emits a neutron to become helium 4
21H + 31H becomes 42He + 1on +Energy
The reason that energy is produced is that the combined mass of the deuterium and tritium nuclei is slightly greater than the mass of the one helium nucleus. This tiny difference becomes energy.