The best thing you can do is change your environment! If you know you struggle with a food, that’s perfectly fine, but why keep it around?
Fact is, some people do struggle with some foods in moderation. Some people can eat one cookie and be fine, but others go all in after one. It’s fine! The important thing is recognizing which you are!
I suggest removing the food that causes you trouble! Donate it and never buy it again!
If you’re serious about the change, then take the “willpower” out of it and set yourself up for success ahead of time! MAKE the change, don’t make it harder!