How do Windmills Produce Electricity?

When the wind turns the windmill, it is also turning a shaft connected to the windmill. That shaft is connected to a generator, which when turned produces electricity.