Feeling like I’m on autopilot

I feel like some days I’m on “autopilot”. I am not conscious of my thinking, I just go about my day not caring about the consequences of eating food I don’t want to eat or drinking when I wish I wouldn’t. Then there’s other days where I’m disciplined. I’m trying to come up with a plan for when this occurs but at the time Its happening I feel like I don’t notice it until it’s been a few days. Do you have any advice for me?