It takes time. It takes repeating. It takes doing it in different ways and in different situations. There is a lot involved in going from an old behavior, which suited one set of purposes, to a new behavior serving an opposite set of purposes. You are making a big change in yourself when you are going from eating too much food and eating too many fattening foods to eating to lose weight and then eating to maintain the weight you lost.
You have to seriously reduce or eliminate the old behavior and bring about the new behavior. You probably know how old behavior can be, especially if it has become habitual. It is hard to change. Back it comes when you least expect it or want it. You might even say old behavior resists change. Take using your dominant hand, for example. You automatically use your dominant hand without even thinking which hand you should use. To change to the opposite hand, you would have to work away at using your non-dominant hand and restrict the use of your dominant hand. There is no doubt, is there, that you would have lots of resistance to changing hands for good and making your non-dominant hand your go-to hand for the rest of your life.
What does all of this have to do with food and eating and losing weight and keeping your lost weight off? Think of it this way. Your dominant hand is the way you are used to eating, while your non-dominant hand is the way you are not used to eating. This is a pretty kettle of fish, isn’t it?