Shopping can be a form of relaxation. But it can turn into an expensive habit.

Whether you sometimes give in to a weakness for designer handbags or brand-name shoes, here are three ways to help you manage the urge to spend.

1. Pretend (or postpone)

If you want to feel like you went shopping without spending any money, do everything you would when you shop — short of buying anything.

Browse online, pick out a shirt in your favorite color and even add it to your cart. If you are in-store, go window shopping without your wallet. Then wait. "Have some type of cooling off time period before you commit to purchasing the item," said Ross Steinman, a professor of psychology at Widener University in Pennsylvania.

That delay period will vary from person to person, but Steinman suggests waiting at least one day. Depending on the purchase, you could wait a week or even a month before deciding whether to buy.

This might be enough to work the urge to buy out of your system. But just in case, eliminate any remaining temptation. "Delete those items so that they are not waiting for you in your shopping cart," Steinman said.

2. Prepare

At some point, you will surely need to buy something. And that is OK.

It is best to still go to stores, rather than avoiding shopping altogether, advised Kevin Chapman, a licensed clinical psychologist in Kentucky. That is, as long as you prepare yourself mentally before you shop.

"Ultimately, you're teaching your brain a new association. Meaning I can think of a store like Target or Costco or Ikea and think that it doesn't compel me to shop per se. It's just another store."

He compared the strategy to overcoming a fear of elevators. "Say I have an elevator phobia. Well ultimately, at some point, I have to confront an elevator," Chapman said. "But the way you do it is you don't throw someone into an elevator and say, 'sink or swim.' "

Instead, you prepare so you know what to expect. Recognize that you have a tendency to overspend. Create both a budget and a list before you go shopping (in-store or online). Then, hold yourself accountable to that list.

3. Ponder

As you shop, keep track of your buying behavior so you can identify patterns. Steinman recommended noting things like the cost, time of day and what the item was for, among other details.

"It will raise awareness about how much somebody is spending and also identify trigger points," he said.

Ask yourself questions about any trends that you notice. Do you mostly make purchases in the late evening? During the day? After you have had coffee and increased your energy level? What about after you receive your paycheck?

As you do so, think about your emotions. If you are looking for the high that comes along with shopping, Steinman recommended doing something else in its place that gives you a similar feeling.

And keep in mind that the temporary emotional high that comes with impulsive shopping is just that — temporary, according to Chapman. It may be a little easier to give up overshopping if you know the feeling is fleeting.

Courtney Jespersen is a writer at NerdWallet. E-mail: courtney@nerdwallet.com. Twitter: @CourtneyNerd.