The reaction releases energy due to something known as a mass defect (def). Each consituent part of a nucleus has a specific energy attributed to it. When these are bound together in fusion, some energy is emitted in the process. Due to mass-energy equivalence, the mass of the resulting nucleus is therefore less than that of its consituent parts.
Fusion has great potential to be a sustainable energy source - fusing together two hydrogen atoms would result in a helium nucleus plus energy. We have hydrogen in abundance, and helium is inert (def), leaving the process without the nuclear waste associated with nuclear fission. However, we cannot yet achieve nuclear fusion on Earth due to the incredibly high temperatures needed to fuse the two (or more) nuclei together.