Make a list
Keep pen and paper ready in a kitchen drawer. Every time when you run out of something or when you see that you will run out in the coming week, write it down. This way you're much less likely to forget things.
Before going to the grocery store, finish your shopping list. Plan your menus for the coming week and add the ingredients to your list.
Important: once you're at the store, actually stick to your list. Don't put things in your cart that aren't on your list.
Don't go more often than once a week
The more often you enter a store, the more money you tend to spend. Try to keep your shopping trips to a minimum. Key to doing this is again by making a good shopping list using the method I described in the previous point.
Eat before you go out
Put something big in your cart
Like a huge pack of toilet paper, first thing when you enter the store. Your cart will already look almost full, and you'll put in less. Don't forget to get rid of the big pack of toilet paper before going to the check-out.
Skip irrelevant aisles
While you're waiting in line for the check-out, go over every item in your cart. Think to yourself: "Do I really need this? Is this a luxury item I can do without?"
Remember: You are allowed to change your mind! You can still chuck something out of your cart if you don't really need it at this point.