....and suppose there is an emotional trigger to eat them when logic like that flies out the window?
Speaking as a guy who lost more than 100lbs when I got my act together some yrs ago.....
Don't buy anything that doesn't fit the diet you're aiming for...
If you don't have it, you can't impulse eat it.
I went 'no-sugar' - because refined/processed sugars where the problem for me (I had a terrible sweet-tooth)
STRICTLY restricted myself to a sweet 'treat' of a bowl of ice-cream, once per week - so I only bought 1 container (enough for 4 bowls) once a month.
If I ever weakened and ate more..... I would run out quicker and would have to wait longer until I bought the next container.
Oh! - And I deliberately bought diabetic ice-cream only.
I'm not diabetic.... but diabetic ice-cream contains less sugar than standard.
I thought it wrong to waste food.
And if this is a genuine concern for you...
Either give it away, or use up what you have, and when you run out of the 'bad' foods, don't buy any more.
Self-control is the key - and it's far easier to resist buying it, than to resist something that's close to hand at times of weakness.