The primary cause of local winds is convection. This is most often brought about because of the heat of the sun.
One of the most common types of local wind is a sea breeze. The way sea breezes work is similar to other forms of local wind. When the sun is hot, the ground heats up. This also causes the air above it to warm up, which in turn makes it less dense. Because the air is less dense it starts to rise.
Things are different over the water. The sea absorbs the heat from the sun more than the land, so it does not warm up as much. This means the air above it does not warm up either, and because it is not warm, it does not rise. The result of this is a pressure difference as the warm air above the land rises and the colder air above the sea stays.
The lower pressure exists over the land, so the cold air moves in to equalize it. This is known as a sea breeze, or a local wind. Other examples of local winds are slope winds and valley winds. The air temperature in a canyon, for example, is usually warmer than the air at similar elevations above a plain.