The is the only thing that works for me. If there are cookies, I will eat them. If there are no cookies, I don't eat them. Period. I freely admit that it is exclusively a failure of willpower, but it's something I have to work around.
Unfortunately, my wife is the complete opposite. She thinks it's crucially important to stock some of every possible treat, so that when she has a craving she can eat a tiny nibble, satisfy the craving, and move on. If she can't have a sliver of chocolate on demand, she gets mega-hangry. She also gets angry when anyone else eats "her" snacks. She does most of the grocery shopping, so her strategy prevails.
Needless to say, when we're dieting we regularly end up frustrated with each other.