Likely you can think of a time when you gave in and ate something unplanned, and a time when you resisted eating something that you were tempted to. Which felt better?
Remember, once the temptation to eat something unplanned has passed, you won’t regret not having eaten it. Remind yourself, “I won’t regret the food I don’t eat (holiday food, treats at the office), but I definitely will regret the extra, unplanned food I do eat.”