I often hear people say “it’s ok in moderation” when they rationalise their continuation of nonconstructive habits. This happens even when they have said they have wanted to change. For example, I’ve heard “It’s ok, I can still have a treat from time to time” from people who keep saying they are trying to lose weight.
The problem is, however, that the mind is not very good at dealing with vague goals. Instead, the mind hears “from time to time” and makes that fit whatever your strongest drive is in the moment (like a craving).
What helps, instead, is to provide some kind of concrete limit. For example, rather than generally staying away from unhealthy foods, one might decide that their limit is three unhealthy meals and three unhealthy snacks per week. It puts things in black and white and makes a goal more achievable.
Obviously you’ll need to stick to your limits too, but this is a good place to start if you’ve fallen into the same trap as the majority of people out there.