Shift the habit
This is the hard part. Once you’ve identified what’s missing, switch in a more useful behaviour. If you’re bored, for instance, have a chat with a colleague rather than heading for the biscuit tin. Low on energy? Switch to black coffee or an apple.