Some of the best ways that worked for me were:
1. Wait a day or two before actually making the purchase.
2. Write down or think through your head if you'll actually be using these things on a regular basis.
3. Look at your monthly expenses and see if you're going over budget.
4. Is it a luxury? Will it impact my financial well-being?
I think 1 and 2 work the best for most people
