If you see the food, you’ll want it. Plain and simple. Don’t leave it out on the counter, or you’ll find that you eat it much faster than if you hid it.
When I’ve bought junk food, I often put it in the pantry, and have forgotten about it for a week or more. We’ve ended up with at least 2 bags of Cheetos’ hot fries in our pantry because we forgot about them.
Even with foods you’re trying to ration, put them in the pantry.
Out of sight. Out of mind.