One general technique which applies to all spending, not just spending on food, can be to track it. With groceries you might decide what sort of categories to break it down into, at least roughly speaking. For years I would do a break down into eating out, general groceries, and junk food. This was mostly to see just how much I was spending on junk food and restaurants. Then using my "real hourly wage" I'd evaluate how much of my life I was working to pay for these things and decide if I was getting fulfillment equal to the cost. If I wasn't then it was really easy to painlessly stop doing it. The main point was to become aware.
Some categories you might consider seeing what you are spending in might be meat, heavily processed foods/ready made meals, basic fruits/vegetables/grains, and restaurant meals.
For myself I have gone to a pretty much whole food plant based diet. I find I spend less on groceries, though I when buying fruits and vegetables I usually shop for what is on sale/in season. However, even before buying food I am trying hard to readjust my thinking to first "shop" around my homestead, utilizing whatever is growing in the gardens or can be wild foraged. That will be the best, most nutritious, and cheapest food. However, there is still a strong ingrained habit to regularly go shopping for groceries even when I don't really need to. Then I feel the need to eat that food I bought before it goes bad, thinking the stuff in the gardens/yard can wait because it hasn't been picked yet. Repeat with another round of ingrained shopping and what seems to happen is that I end up missing the harvest season on things because I'm always trying to eat that purchased food going bad.