How are sand dunes formed?

Sand dunes are ridges or hills of sand found at the top of a beach, above the usual maximum reach of the waves.