Windmill is a machine that converts wind energy into mechanical energy then mechanical energy into electrical energy.
Rotor blades mounted with rotor.
Wind rotates the rotor blade, which turns the shaft of the rotor, which ultimately rotates the shaft of the generator and produces electricity.