For more than nine years, the stock market has mostly risen, but memories linger of when it went down, down, down. Those memories were reignited recently when the Dow Jones Industrial Average plunged more than 800 points, or 3.2%, in a single day on October 10, as rising interest rates and trade tensions between the US and China scared investors.

It can be hard to tell when a market pullback is a just a blip…part of a healthy correction of 10% or more…or the start of a bear market that could last months or even years. Either way, be on guard against falling into the costly traps that often are triggered by plunging asset values. Here are two ways that human psychology fools us into making bad decisions in times of financial loss and what we can do about it…

Our brains liken investment losses to being robbed. Money that once was ours has been taken from us (even if our investments overall have net gains). It feels like a violation, and being violated is so unpleasant that we might flee from stocks and stock mutual funds, greatly diminishing our long-term investment returns.

What to do: If feelings like these gnaw at you when your investments decline in value, check how many shares you have of particular stocks and funds. Assuming that you haven’t already sold any shares, it will be the same number that you had before the pullback hit (maybe even more, if dividends were reinvested). Use this share count to reassure your mind that in this sense, nothing has been taken from you. Instead, the market decline has temporarily affected what other people would pay you for your shares.

Our brains warn us to run in fear when share prices are falling. The primitive part of the brain encourages us to flee from danger, and a tumbling market seems dangerous. But in the long run, we’re better off buying than selling while share prices are depressed.

What to do: When stock prices drop and your panicky mind screams “sell—this is dangerous,” respond with the thought that “stocks are on sale for a short-time only, and I’m shopping for bargains.” That doesn’t mean you should load up indiscriminately, but it does mean you should have a plan for finding bargains. Keep in mind that by April 2012, stocks overall had recovered from the bear market of 2007–2009, and the S&P 500 has quadrupled from its 2009 low.

If bargains don’t excite you, reframe yourself in your mind as a hero who takes wounded, bleeding stocks under your care until they recover. You’re less likely to be scared out of the market if you cast the stocks as the victims and yourself as the rescuer.