An air shot is a swing that misses the ball completely, which still counts as a stroke if you were trying to hit it.

A practice swing doesn't count, even if it's close to the ball, but a genuine attempt that misses does. Tee it up again if you were on the tee; otherwise play the ball from where it lies.