Same thing happens to me everytime I have my money and whenever I go to malls. After buying unnecessary things, I also regret. But now I am trying to alot my money on my necessities. I try to distribute and allocate my money to fit my budget. And if theres an extra, thats the time I used it for my me time.
A good way to track your spending habits especially to unimportant things is to keep a record of your expenses. This way you can check where your budget goes to and review it so that you can trim down expenses on certain things.