How do we get energy from the wind?

Wind energy is endless and cheap but it isn’t always predictable. So how to wind turbines work to harness the kinetic energy of the wind and transform it into electricity?