The wind is used to turn blades, and this motion can be used to turn a turbine or generator. Having something move in a circle turn something else is the easy part of the understanding. What really must be turned is one or more, and it is usually more, loops of wire in the presence of a magnetic field.
If electric charge is moved across a magnetic filed the electric charge experiences a force that moves it perpendicular to both the magnetic field and its own motion. A metal wire has electrons, which are electric charged objects, moving about in it. So, if you move a wire across the magnetic field the electrons in the metal will move along the wire. The magnetic field goes from the south pole to the north pole of the magnet. So, the loops of wire are placed between the north and the south poles of a magnet. As the loop is rotated across the magnetic field charge will flow up on one side of the loop and down on the other, than as the sides swap position the flow is reversed. This reversal happens when the wire loop is oriented parallel to the magnetic field. When the loop is perpendicular to that invisible line no electrons flow. So, the generator produces alternating current.
Taking the current off of the loops for useful purposes requires metal brushes that touch two rings. The rings are on the axel that turns the wire loops. One ring is connected to one side of the loops, and the other ring to the other side This arrangement of using brushes is to keep the wires from getting twisted.
So, a windmill takes the wind energy, converts it to mechanical energy of the turning blades and wire, which converts the turning energy to electrical energy by moving a conductor in a magnet field.