That jolly man in the red suit was onto something -- keeping a list and checking it twice. Next time you're going to the grocery, you should do the same before you leave home. And have a budget in mind. Even if you don't know exact prices, you should have an idea of how much each item on your list will cost. Make sure everything you need doesn't add up to more than you've budgeted.
Once you get to the store, resist the temptation to buy things not on your list, unless they're items you're substituting that are on sale or cheaper than those on your list. Also consider taking a calculator to the store -- your phone probably even has one. It can help ensure everything you're buying is within your budget. If you start to go over, you can take a few things out of your cart.