Getting away with temptation is a good step on keeping yourself from spending on non-essential things, knowing that you can buy the thing you see.
I think it's a natural thing for us to get interested on the things we don't have, especially the flashy ones, and then regret for buying it. It's a matter of decision-making, and self-control for you to stop spending from on unimportant things.