Seriously, I can’t stop you from eating bad food, and there is no magic trick either, but I sure can help you with this one trick that really works.
If you want to stop eating something, or at least eat less of it, let’s say potato chips for example, just don’t buy any! So when you’ll get hungry at home, you won’t have any lying around and you’ll eat something else. It doesn’t make it any easier the rest of the time, but if you’re eating at home or eating food that comes from your home 80% of the time, we can say that 80% of the time you won’t be eating chips, which is probably already better than what you’re currently doing.
It doesn’t mean to eat less, but to eat better food, instead of buying chips, buy more vegetables/fruits/nuts or even meat if you want. Even if it doesn’t taste as good, when you’ll actually be craving for something, there’s a chance you’ll be too lazy to go to the convenience store and you’ll manage to eat what you already have instead of going out.
It really works, I do it, if I buy chips, I think about eating them as long as there are some left in the bag, but when I don’t have any, I eat anything else that I have and I manage to survive anyway. I still eat them sometimes, because life is not only about suffering, right? But I reduce access to it as much as possible so I can have more control over what I eat.
I used the potato chips as an example, but it should work with pretty much everything else, if you don’t have easy access to a particular type of food, you have a lot less chances of eating it.