The different options
In thermal power plants, a steam turbine rotates the generator. This requires the continuous flow of high-pressure steam. Burning fuels like coal, oil or gas produces heat. This heat boils the water in the boiler to produce high-pressure steam. This steam rotates the turbine, which in turn rotates the generator. Burning of other fuels like bio-mass or municipal waste also produces steam for use in the turbine. Waste heat from other process can also produce steam.
Nuclear power plants also use a steam turbine to rotate the generator. Steam generators produce steam by utilising the heat from nuclear fission taking place in a nuclear reactor. Geo-thermal power plants use the steam available from underground geo-thermal reservoirs to rotate the turbine.
It is also possible to rotate the generator directly without a steam turbine using other engines. Internal combustion engines, diesel or petrol driven, can directly turn the generators to produce electricity. The gas turbine power plant uses a gas turbine. The thrust produced from combustion of natural gas rotates the gas turbines, which in turn rotates the generator. This is something like using the thrust from the jet engines of an airplane. In Hydroelectric power plants the energy of water stored at a height in reservoirs created by dams, turn hydro turbines and connected generators to generate electricity. In a wind energy farms, force of the wind turns the wind turbines, which inturn rotates the generators attached to them to produce electricity.
There are other methods to generate electricity without a generator using electrochemical reactions. The most common is the battery in which chemical reaction converts to electricity. In a solar plant, energy from the sunlight is converted directly to electricity by using Solar cells. In a hydrogen fuel cell, chemical reaction between hydrogen and oxygen is used to generate electricity.