Most of them operate on exactly the same principle that fossil-fuel energy sources work. Something is exerted to turn a magnet inside a coil of wire, or a coil of wire inside a magnet.

This converts the mechanical energythat turns the thing into electrical energy.

In a fossil fuel generator, you burn the fuel to heat water, which pushes steam through a turbine to turn the generator.

For a wind turbine, it just uses the wind to turn gigantic fan blades to turn the generator.

For hydroelectric, the water falling through the dam turns the turbines.

For solar-thermal, an array of mirrors collects and concentrates sunlight to heat a target, which heat can boil water and turn a turbine.

The only one that's really different in the fundamental mechanism is photovoltaic. Photovoltaic utilizes the Photoelectric effectinside a p-n junction (diode), where light pops electrons out of the depleted region of the p-n junction where they are collected at the terminals, generating a voltage and current.