Several possibilities:
1. A fan (directional) or rotating cups (omnidirectional)
2. thermal- you have a heated thermistor which you also read the temp of. As airflow increases, it cools faster. To be accurate, you need to know not just air temp but pressure and humidity (optional).
3. Ultrasonic. Since the waves travel with the moving air, transit time is different upwind/downwind. There are some commercial systems that work this way.
4. Pitot airspeed- a very accurate differential pressure sensor (1 psi is about 200 mph of wind) senses the difference between a tube facing the wind and another opening to static air. You need to know air temp, pressure, and humidity (optional) to be accurate.