Chances are, if you're a long-term investor, you will find yourself facing stock market crashes at one point or another. There have been many throughout time, with the most recent being the 2020 coronavirus market crash.

But there is a silver lining in this dark cloud: As a long-term investor, you'll also benefit from better days -- such as bull markets that should lift your portfolio. And this means that throughout your investment life, you will have plenty of opportunities to make up for market crash losses.

To best minimize losses and maximize gains, though, it's important to make wise decisions during those tough times. Here are three things you absolutely shouldn't do if the market crashes.

1. Focus on the short term

When an index drops in the double digits over just a few days and your favorite stocks follow, it's hard to avoid short-term thinking. And it's easy to look at the losses on paper and panic. Instead, though, you should double down on your long-term mindset.

Consider how much a particular top stock -- one that's falling now -- actually has progressed over time. Let's use Amazon (AMZN -1.64%) as an example. During the coronavirus market crash, Amazon shares lost more than 15% in just a couple of weeks. Over the past decade, though, Amazon stock has soared more than 500%.

When you look at stock performance from that long-term perspective, it's easier to keep calm during difficult markets -- and understand the short-term losses probably won't impact the value of your investment very much over time.

If you just look at a stock's performance as the market is crashing, you may end up making a bad investment decision -- one you'll regret once the market rebounds.

2. Look at share performance instead of earnings

You might not completely ignore earnings reports during a market crash -- but you may focus a bit too much on what the stock is doing and not enough on certain key elements in the company's earnings report.

This time, I'll use an example of a company's stock and earnings performance during a bear market. Costco (COST 0.17%) slipped 19% last year. At the same time, though, earnings continued to grow.

COST Net Income (Annual) Chart

COST Net Income (Annual) data by YCharts

And a close look at the company's earnings reports and business model show Costco is a great stock to own -- even in tough economic times. It offers rock-bottom prices on essentials -- something customers are looking for in a weak economy. And the membership business model also has kept shoppers coming back. They've paid an annual fee, so they want to get their money's worth.

So, during a market crash, instead of focusing on stock price, check out the company's recent earnings reports. Can earnings continue to grow during a tough environment? Is the company making moves now to successfully manage the difficult times? And, importantly, are future prospects still bright? Even if earnings have slipped, a positive answer to those last two questions may make this a stock to hold on to.

3. Favor selling stocks over buying

During a crash or at any point in time, you may consider selling a company you've lost faith in -- or a stock you believe has reached its full potential. But, in general, a market crash isn't the best time to sell. That's because it may mean selling at a loss.

Of course, it might be tempting to sell a stock just because it's dropping. The fear is, if you don't get out right now, you'll lose even more money. It's true that you may lose even more -- on paper -- in the next few weeks or months.

But, over time, the stock you're ready to sell may recover and go on to deliver top performance. My Amazon example applies here too. So, in most cases, the best thing you can do regarding your current positions is hold on and wait until the market environment improves before making a decision to sell.

Meanwhile, don't be afraid to buy stocks. During crashes, you'll find some top companies trading at dirt cheap valuations -- that's because many investors will indeed sell shares. As billionaire investor Warren Buffett once said, "Be greedy only when others are fearful." Buffett is known for buying when valuations are down.

So, market crashes make great opportunities to check out a company's financial strength and long-term prospects -- and if they look good, dive into the market with confidence.