The standard advice when the stock market tanks is to remain calm. Don't panic. Don't frantically sell. If you can avoid it, don't even log into your investment account. Stocks tend to increase in value over the long run. Panic selling when stocks tumble and buying back in once they've recovered is a recipe for terrible performance.

That's good advice, but it's hard to follow. It's too easy to come up with justifications for making bad decisions. All the risks you factored into your original investment decisions become amplified in a crisis as new, unanticipated risks emerge. All you can think about is what can go wrong.

A man holding his head with charts on a computer screen.

Image source: Getty Images.

That's relevant as the novel coronavirus outbreak that originated in China spreads globally. Italy is now in full lockdown. Hundreds have died in hot spots like Iran. Globally, the virus has infected over 100,000 people and killed more than 4,000. In the United States, the situation could get worse before it starts to get better. 

The stock market is gyrating wildly against this backdrop. On March 9, the S&P 500 logged its worst day since the financial crisis. On March 10, the index soared nearly 5%. No one knows what to do, and it shows.

How do you invest in this environment? The key is to remember a very simple idea. Howard Marks, the billionaire co-founder of Oaktree Capital, publishes memos once in a while that every investor should read. In a 2015 memo titled It's Not Easy, Marks laid out a critical nugget of wisdom: "Most great investments begin in discomfort."

You should feel a little sick

It's easy to buy stocks when they're going up. It feels good. The feedback you get as stocks continue to rise strokes your ego, even if your results were purely based on luck.

When stocks are tumbling, it's much harder to pull the trigger. You buy a stock; it goes down. You buy another stock; it also goes down. You become demoralized. You may have been jazzed about "buying the dip" at first, but that enthusiasm vanishes as time goes on and losses pile up. The idea of buying stocks starts to make you feel sick.

That nauseated feeling is the price you pay for the stock market's long-term returns. If you buy stocks when it feels good and sell when it starts to feel bad, which is what many people do, you'll be disappointed by your results. You'll miss out on those rare opportunities to score incredible bargains.

I bought shares of Spirit Airlines (SAVE -3.80%) last week. It felt bad. The stock has crashed on coronavirus fears, and it could very well drop further. The airline industry is going to be hit hard by the coronavirus outbreak. The potential for a 70% decline in domestic demand in the coming months is within the realm of possibility. It could even be worse if the economy is thrown into a recession.

I've never invested in an airline before, and I don't particularly like the industry. But five years from now, I'm pretty sure people won't be avoiding flying anymore. I could be wrong about choosing Spirit instead of the larger airline stocks, but Spirit has limited international exposure and a pile of cash. I don't how much the stock is worth, but I think it's probably worth a lot more than where it trades today.

I'll probably buy more shares of Spirit if the stock tumbles further. It won't feel any less uncomfortable. I'll be buying as the airline industry is in crisis. It will hurt every time I hit the "buy" button. I might be completely wrong. That's why you diversify enough so one mistake isn't the end of the world.

Most great investments begin in discomfort. A lot of bad investments begin in discomfort, too. Investing is hard. But don't let that discomfort keep you on the sidelines. If there's a company you believe will survive this crisis and thrive once the outbreak is over, there's no better time to invest than right now.