If the wind is blowing, elephants will face into it and extend their ears to benefit from the effects. If there's no wind, they'll flap their ears to create air currents around them that carry away heat from their bodies.
Elephants do many different things with their big ears. One thing is that they can cool themselves down when they are hot. The blood flowing through the ears is close to the outside of the elephant body, and heat can be released as they flap them about.