The usual source of chemical energy is a fuel that can be burned in oxygen like coal or diesel. These are burned to produce heat energy which can heat a working fluid to power a heat engine to drive a rotating electrical machine to convert mechanical energy to electrical energy. The usual method is to burn coal (fuel) to heat water (working fluid) into steam to drive a steam turbine (heat engine) to drive a synchronous machine (rotating machine) to generate electrical power.
Quite often mechanical potential energy in the form of gravitational potential is used either as a way of storing energy or as a source of naturally produced energy, by dint of water stored in dams: water flowing down hill directly drives a turbine connected to a rotating machine to produce electrical power. When there is an excess of electrical power, a rotating machine can use electrical power to drive a pump to pump water into the dam against gravity to store energy for use in peak times.
Other methods could convert chemical energy directly to electrical energy: a fuel cell could be used to combine a fuel (maybe from natural sources like ethanol or methane or produced artificially like hydrogen) with oxygen directly to produce electrical energy. This is useful if you have a source of fuel and oxygen directly availible, like in a space craft, or using hydrogen as an energy storage medium.
Some methods can convert heat energy directly to electrical energy, like a nuclear battery: this relies on the direct conversion of heat from the decay of a radioactive material to electrical energy through the use of the seebeck effect.
We could use thermal energy from the decay of radioactive elements in the earth through geothermal (the heating of the core of the earth is supposedly partly due to the decay of radioactive elements) methods: we can pump a working fluid (usually water) into the ground to be heated geothermically to drive a heat engine to drive a rotating machine to produce electrical energy.
The source of essentially all energy on earth is from the sun (including fossil fuels). We can use energy directly from the sun (almost all of which comes in the form of electromagnetic radiation) in a few different ways, all called solar power: we can use the light to heat a working fluid (like sodium nitrate) to drive a heat engine to drive a rotating machine. Or we can go directly from light to electrical energy without a rotating machine by using photovoltaic cells.
Of course there are other paths to produce electrical energy I havnt mentioned here.
Almost every electrical motor can be used as a generator.
when conductor is rotating in a magnetic field an E.M.F will be induced in the conductor according to faraday's laws of electro magnetic induction.Current will flows when conductorforms closed circuit.
rub a balloon against a sweater a bunch of times.