Almost all forms of primary energy come from nuclear reactions. Fossil fuels and biofuels got their energy from sunlight. Geothermal energy comes from radioactive decay or thermal energy left over from when the Earth originally formed (which came from a cataclysmic nuclear explosion, a supernova). Of course, nuclear reactors ultimately get their energy from nuclei.
This nuclear energy is potential energy stored inside the nucleus of an atom. The protons and neutrons inside of the nucleus are held together by the strong nuclear force, which balances the repulsion of the Coulomb force between the protons. The weak force balances the number of neutrons and protons. The strong nuclear force is both stronger and shorter ranged than the Coulomb force, which makes nuclei stay together up to a particular size (a sphere with a radius of about 8x10-15 m). The balance between the strong nuclear force and the Coulomb force is much of what determines whether a nuclide (particular combination of protons and neutrons) will be radioactive or stable. Unstable nuclei release energy, usually a lot more energy than a chemical reaction.
Nuclear energy is released through three processes: nuclear fission, nuclear fusion, and radioactive decay. Fission occurs when heavy nuclei become unstable and split into smaller parts (usually two main parts and some extra neutrons), fusion happens when light atoms are forced together, and radioactive decay occurs when unstable atoms emit energy and become more stable in the process. Fission can occur spontaneously, but when energy is obtained by humans from fission the process generally occurs after a large isotope has been bombarded by thermal neutrons. Fusion is not yet a viable method for humans to directly obtain energy from nuclei, but it is the process that occurs in the Sun. There is more energy involved in nuclear processes (compared to chemical reactions) causing a measurable amount of mass to be lost known as mass-energy equivalence. When any of these three processes occur, the resulting atoms have less mass than the starting atoms. This mass is converted into a large amount of heat energy, explained by Albert Einstein with his famous equation . There are processes that occur in a lab in which energy is turned into mass, but that doesn't happen spontaneously.
The energy released from nuclei is considerably more dense (about a million times more) than the energy that comes from the interaction of atoms (chemical reactions). This is what leads to the incredibly large and destructive power of nuclear weapons compared to conventional weapons. This energy density also means that there is remarkably little fuel needed to generate electricity. With a million times the energy density, only one millionth of the fuel is needed, producing one millionth of the waste that chemical reactions release. However, that waste contains residual nuclear energy in the from of radioactive decay of fission daughter products which is quite dangerous if not properly disposed.
Nuclear energy can be used directly to generate electricity, and is what we call nuclear power. Nuclear bonds require quite a bit more energy to break them apart then molecules do; this means that a great deal of engineering must go into creating nuclear power. The energy coming from the nuclei can be used to heat a liquid or gas to run turbines in a nuclear power plant, producing electricity. Currently, nuclear power supplies 6% of the world's primary energy and 14% of its electrical energy (almost half of the electricity that doesn't emit greenhouse gases).
In power plants, nuclear power is harnessed from isotopes of large elements such as uranium, thorium, and plutonium as fuel in nuclear fission reactors. The uranium and thorium isotopes occur naturally and are mined from rock. Using uranium in a nuclear reactor can make plutonium, which can also be burned in nuclear reactors. One interesting use of nuclear reactors is to get rid of old nuclear warheads. The United States did this with old Soviet nuclear warheads and called this project megatons to megawatts.
Commercial nuclear fusion for generating electricity does not yet exist, but fusion has been successfully achieved by humans in laboratories. The big difficulty is getting more energy out of the reaction than went into making it in the first place.
The public perception of the safety, reliability, and cleanliness of nuclear energy (as opposed to the actual safety, reliability, and cleanliness) have often led to difficulties for the nuclear industry. Public fear about how nuclear waste will be dealt with has lead to a reluctance to adopt or expand nuclear power. Other fears have come from concerns about specific nuclear disasters and how nuclear energy is used outside of electricity generation, like for nuclear weapons. There's a strong sense of NIMBY (not in my back yard) for new nuclear power plants. Advocates for nuclear power point to nuclear power as being a carbon-free (and generally, emissions-free) alternative to fossil fuels that could provide significant amounts of energy worldwide. Critics are generally concerned about health risks associated with nuclear plants, pointing to nuclear disasters such as Chernobyl and Fukushima as examples of how nuclear plants are unsafe.