Substitute other actions: a sharp intake of breath, as though inhaling but without smoke.
Chew a piece of gum or crush a mint. Take deep breaths and calm yourself. Wait until the urge passes. Maybe walk by a stuffed ashtray and congratulate yourself that you are no longer tied to this habit. Calm and positivity are key.