During takeoff headwinds help to increase lift, meaning a lower ground speed and a shorter runway distance is needed for the plane to get airborne. Landing into the wind has similar advantages; less runway is needed and ground speed is lower at touchdown.