Eating habits

I'm trying to eat healthier to lose weight but no matter how hard I try to do it I grab bad food instead and I just feel it's getting out of control even know I told my self not to eat those things I still do

How do I make my self stop doing that it really gets me down and makes me feel ashamed