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 so much energy involved in nuclear processes (compared to chemical reactions) that a measurable amount of mass is lost; this is called the 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 than the energy that comes from interacting atoms (which are chemical reactions), about a million times more dense. This is what leads to the incredibly large and destructive power of nuclear weapons that is just not possible with conventional weapons. This energy density also means that there is remarkably little fuel needed to generate electricity. With a million times the energy density, one million times less fuel is needed, and one million times less waste is generated. That waste, however, still has residual nuclear energy in the from of radioactive decay of fission daughter products.
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. Putting uranium in a nuclear reactor can make plutonium, which can be also burned in nuclear reactors. One interesting use of nuclear reactors is to get rid of old nuclear warheads. This project was called megatons to megawatts in the United States.
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 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. Please see public acceptance of nuclear power for a more full discussion. Please see public attitudes towards energy sources for historical trends in public opinions on this subject.