One of the best ways that I know of to not buy something on impulse is to wait overnight before making a decision. This is especially necessary when a "big" purchase is involved (big can even be at $100 for some). All too often we get emotionally married to something and try to logically rationalize our impulse behavior. Therefore sometimes you just need to distance yourself and wait overnight.
Also in order to be more thoughtful of your buying decisions you should use cash, the green paper stuff, instead of plastic. Studies have shown that when you actually spend cash you spend less.