I can't add anything helpful to what Alpha has already said, but I think it is very common to feel like that. It might be helpful to have a look up the 'stages of change' model - basically the idea that there are different stages of readiness for change. Earlier on in the stages is the considering change, wanting to change and starting to think about ways of changing. But it's not always easy to put that into action, especially when doing the opposite is such an automatic thought.
I think as said above, it sounds like your eating is related to your emotions sometimes, and that you're associating it with comfort? Could you try to think of some other strategies for self-care when you need comfort like that?