For years my Saturday routine was the same: buy a week's groceries, then find half of it slimy by Thursday. What finally worked was writing down what's actually inside the fridge and freezer the moment the groceries are unpacked, including the half-used bottle of sauce and the two carrots hiding at the back, and then planning the week's dinners from that list instead of from whatever looks nice at the market.
I kept trying this on paper and giving up after two weeks, so now I just use an app for it. It's called Wonder Fridge and it keeps track of what's in the fridge, freezer and pantry, and reminds you when something is getting close to its expiry date. It runs on both iPhone and Android, and it was made by a small two-person studio that has been updating it for a few years, so it feels like an ordinary household tool rather than something that appeared last month.
Since we started, our grocery bill has gone down and the bag at the end of the week is mostly packaging instead of food. The app is really just the reminder though; the part that matters is checking the list before buying anything.