Nuclear reactions are of two types: fusion and fission. In the former, smaller atoms (such as hydrogen) fuse together to form larger atoms (such as helium). In case of nuclear fission, larger atoms (such as uranium) break into smaller atoms (such as barium and krypton). In both the cases, energy is released. Sub-atomic particles- neutrons and protons (also called as nucleons) are bound together by nuclear forces. Binding energy per nucleon suggests that more stable nuclei can be formed either by fusion of lighter atoms or splitting of very large atoms. In each of these cases, extra nuclear energy is released during the formation of new nuclei. And this is the energy that is harvested during either nuclear fusion or fission. The energy released from fission is commonly used for making electricity and bombs. Nuclear fusion has not yet been successfully sustained for long enough duration to get electricity from it and is used for making nuclear weapons.
Hope this helps.