Differences in temperature. Warm air is less dense than cold air, so it rises. This creates a difference in air pressure, which then causes wind.
The earth's rotation. The earth's rotation creates a force called the Coriolis effect. This force deflects the wind to the right in the Northern Hemisphere and to the left in the Southern Hemisphere.
Obstacles. Obstacles such as mountains, buildings, and trees can block the wind or cause it to change direction.
Friction. Friction between the air and the earth's surface slows down the wind.