At some point in your life, you have probably rolled something down a hill. As you noticed, when something starts rolling, it continues rolling. Without something to stop it, an object will keep rolling with a faster and faster pace. This is an analogy which can be applied to us. You’ve probably had a lazy weekend where you sit on the couch and watch TV for a long period of time. By the end of it, you don’t feel like getting up at all. You feel like a lazy person, just from 1-2 days of being lazy. A similar idea works with diets, you can eat super-healthy but eventually a day will come where you "cheat" by eating some junk food. This is like the start of rolling down a hill, you can either let it continue or stop it.
I happen to believe this "hill effect" is the sole thing which will make a diet successful or not. Sure, knowing that one food has less calories than another is nice, and it helps to make some good habits, but that knowledge is not enough. This knowledge is in fact available to anybody who reads the back of a food package. Every single one of my clients with a weight loss goal has lost significant weight, not because of nutritional knowledge but because of stopping the analogous ball whenever it starts rolling down the hill. Everyone will have moments of weakness, how you respond to these moments is how you write your own story.
The next time you find yourself rolling down one of these hills, recognize that you are rolling down and just decide to make a better decision. Things don’t have to be turned around immediately, but ideally the downward spiral is stopped. I have days like this myself, and my "go to ideas" are a long walk on the beach, or going to the supermarket to make something in my crock pot. Yours can be anything you want, but it should be something.