Depends on the circumstances.
If it's during the day, and I just want to snack on something I shouldn't, I a.) reach for an emergency snack (sweetened yogurt or biltong or prawns) and then start to focus on something I plan to eat later in the day - if burgers, for example, I start to plan the seasoning etc.
If it's while I'm out, socialising, I order a sparkling water and sip that slowly. If the cravings get too strong I will just leave. If I can't leave, and the cravings continue, then I "put on an atkins hat" and chose the least worst option - for example, chosing peanuts instead of doritos, or cheese instead of dessert.