There are two types of nuclear energy: fission and fusion. Fission occurs when a single atom is split, releasing a burst of energy and particles. Fusion occurs when two atoms combine to form one or more new atoms. Fission fuels modern nuclear reactors, while fusion powers the sun.
Nuclear fission was developed during World War II, initially to power devastating weapons. However, when the reaction is carefully controlled, the energy can be harnessed and put to non-destructive use. Most fission reactors use uranium, but alternative designs that use plutonium or thorium exist. These reactors use fission to generate heat, boiling water and the resulting steam to power electrical turbines.
Nuclear fusion is a much more difficult reaction to harness. Uncontrolled nuclear fusion was achieved in 1951 and used to develop thermonuclear bombs, but a controlled reaction is difficult to sustain for the purposes of generating power. The temperatures involved in a fusion reaction make containment difficult, and the right balance of fuel is needed to sustain fusion long enough to harness its energy.
While both fission and fusion have been used to develop weapons, fusion is a much safer technology than fission. A fission reaction, once begun, has to be carefully maintained to prevent a runaway cascade, in which more and more atoms split and release too much energy. Fusion, on the other hand, requires a careful balance of conditions to occur, and if those conditions change, the reaction shuts itself down.