The S&P 500 and Nasdaq Composite have both fallen into a bear market, with each of these broad indexes down at least 20%. Geopolitical tensions are high, inflation is raging, and a recession seems likely. If there's one thing you have to avoid right now, it is panicking. Here are three things you shouldn't do during this, or any, market crash.

1. Don't sell everything

If you've taken the time to create a portfolio of stocks with strong long-term prospects, then a bear market is a terrible time to sell them. The key thing to remember is that the market, and individual stocks, tend to move along a sine curve. Essentially, good times are followed by bad times, and bad times are followed by good times. If you let yourself get caught up in either the upswing or the downswing, you increase the chances of jumping in and out of the market at the worst possible times.

In other words, you'll increase the chances you buy high and sell low. The goal is to keep buying great companies and holding them so you benefit from the long-term growth of the businesses. If you do that and avoid indiscriminate selling during bear markets, you should come out of market downturns just fine. It may take a while, but history suggests that good companies eventually reward investors well.

2. Don't time the market

One of the tempting things to do when markets become volatile is to try to buy at the lows and sell at the highs for quick, easy gains. That will become especially tempting if the market moves sideways for a little bit. Only there are no crystal balls on Wall Street. Nobody is smart enough to know for certain when the market is going to change directions in a sustainable way.

Yes, there will be some big-name investors that correctly identify the bottom or top of the market ... this time around. But there are very few who have done so on a regular basis and in an investable fashion. For example, Cathie Wood looked like a genius not long ago, but now, her Ark Innovation ETF is down some 75% from its 2021 highs, and the exchange-traded fund (ETF) is off nearly 60% this year alone.

Chart showing ARK Innovation ETF's price dropping, and Hussman Strategic Growth's staying level, in 2022.

Data by YCharts.

Meanwhile, Hussman Strategic Growth Fund is up around 18% year to date. But portfolio manager John Hussman has been warning of a major market downturn for years. So his "win" this year is nice to see for shareholders, but if you call for a bear market long enough, you will eventually be proven right. That's very different from accurately identifying the market's peak before a sell-off. In Hussman's defense, this is not actually what he's been trying to do as he has simply stated the market has been trading at a historically elevated premium that would, eventually, result in a bear market.

3. Don't bottom fish

Let's assume you manage to avoid selling everything you own as well as the temptation to try to time the peaks and valleys of the S&P 500. That's great and shows you can stick to your long-term plan. But what about all of the great opportunities to buy stocks during a market downturn? It's very tempting, particularly if you see a stock that's dropped precipitously. Be wary of the urge to buy yesterday's winners.

That isn't to suggest that you shouldn't buy stocks during a bear market. For example, a company like Carvana has plunged roughly 90% from its 2021 highs. It has to be cheap, right? The problem is that the company is bleeding red ink and burning cash, and there's a very real chance it could flame out in bankruptcy.

That's very different from stepping in to buy a company like Medtronic that has fallen over 30% from its all-time high. The medical device company is profitable and has increased its dividend annually for over four decades, making it a Dividend Aristocrat. It has some issues to deal with like product delays and a product recall, but its business model has clearly proven sustainable over time. Carvana? Well, it hasn't even proven it can earn money yet.

In the end, buy good companies with long and profitable histories that are on sale, often called fallen angels. Avoid buying the big "winners" from the bull market that have little history and are likely to be nothing more than a flash in the pan.

Control your emotions

When all is said and done, bear markets are very hard to deal with emotionally. That's basically what ties panic selling, market timing, and bottom fishing together here. Your best bet is to have a long-term plan and stick to it through good markets and bad. For most investors, the best plan will be to buy good companies and hold them, no matter what the market is doing, so you can benefit from their long-term growth. It's easier said than done!