I have a series of things that keeps me from being indulgent....
1. We have a general rule - use everything like it's your last one.
Have you ever put water in a nearly empty shampoo bottle to get a couple more applications out of it? I've taken that even farther and will regularly add water to our shampoo to make it go farther, not just the last bit in the bottle.
So instead of dumping unmeasured laundry detergent into the washer tub, I measure it with a 1-tablespoon scoop (the recommended amount for the brand I use).
The commercial for toothpaste will ALWAYS show a completely covered toothbrush with a lovely swirl of the stuff - when the recommended amount is closer to the size of a small pea.
2. Meal planning. Meal planning is somewhat based on use-by dates of food in storage. I normally don't make peanut butter cookies until I have a jar of peanut butter that needs to be rotated out of storage because of a use-by date and needs to be used quickly. Cookies aren't "free" food, they are portioned out and count as a portion of the Bread/Cereal group in our diet as all foods are.
3. Meal planning is based on the old Basic-4 so that controls much of the food in our diet, as well as being a stickler for serving sizes. Over-eating anything is never good for the food budget.
4-servings Bread & Cereal
4-servings Fruits & Veg.
2-servings Meat/Alternative
2-servings Dairy
So a serving of spaghetti or pasta is 1/2-cup, orange juice is 6-oz., a slice of bread is 1-ounce, an English Muffin is 2-servings, as is a hamburger bun, etc... If we have ice cream and cake, it's not in addition to our daily requirements, it's included IN the daily total of food and counts as a bread/cereal (grain product) and dairy serving.
4. Limited funds, as opposed to UNlimited funds. I have a self-imposed food budget ($50/week for 2 adults). We stock all food with this amount of money and this amount only. We have more than enough money to buy all we want of anything we want, we just choose not to. Perhaps that early story about the grasshopper and the ant made a lasting impact on us.
So I guess those are some of the stop-gap measures I incorporate, but I'd never thought about it until the question was posed, so thanks for bringing the subject up....