Do you have a warm and fuzzy feeling that the stock market will keep its upward momentum going? Are you absolutely confident that it won't crash again over the next few weeks or months? I'd wager most investors answered "no" to both questions.

That doesn't mean you should avoid investing in stocks, though. It just means that you need to be very picky about which stocks you select. Here are three stocks that you won't regret buying even if the stock market tanks again.

Nest with three eggs painted to look like hundred dollar bills

Image source: Getty Images.

1. Alphabet

Google's parent company Alphabet (NASDAQ:GOOG) (NASDAQ:GOOGL) will probably see its advertising revenue decline as a result of the COVID-19 outbreak. During difficult economic times, companies tend to cut back on their advertising spending. That's likely to happen over the next few months as the global economy enters into a recession caused by the viral pandemic.

However, I think that most if not all of the potential sales decline is already priced into Alphabet's share price. The stock is still down close to 20% off its highs from earlier this year. 

The important thing to keep in mind, though, is that any problems for Alphabet will almost certainly be only temporary. I even suspect the company will come out on the other side of the coronavirus crisis stronger than before. People are using many of its products, particularly YouTube, more than ever. I also think that its new Google Meet app could become a big player in the videoconferencing market.

My view is that Alphabet could even be the most important stock to own over the next decade because it's well-positioned to profit from the most significant macro trends, including the rise of artificial intelligence (AI) and aging demographics. I think that investors will be much more likely to regret not buying the stock than they would buying it even if the market sinks again.

2. Amazon.com

Although its shares initially took a beating during the stock market plunge that began in late February, Amazon.com (NASDAQ:AMZN) has bounced back in a major way. That's not surprising in the least, considering that online shopping has surged while many people are under shelter-in-place orders.

If you had any doubt about how well Amazon is doing in the midst of the pandemic, two actions taken by the company provide big hints. First, Amazon announced in March that it's hiring more than 100,000 workers to meet surging demand. Second, the company temporarily suspended its Amazon Shipping service for third parties because it needs all of its resources to ship its own products.

Could Amazon be negatively impacted by COVID-19? Sure. Actually, Amazon has already experienced some pain from the pandemic because it had to delay Prime Day, a move that will probably cost the company around $100 million. A major recession would probably lead to consumers tightening their purse strings, which could affect the e-commerce giant's revenue. 

But none of this should matter to Amazon over the long run. E-commerce will continue to grow. Organizations will continue to move their applications to the cloud. Amazon will profit from both trends. And it will continue to explore new markets to conquer. I think that buying the stock now regardless of what the stock market does is a smart move.

3. Mastercard

Mastercard (NYSE:MA) has been hit the hardest of these three stocks. Its shares were down more than 40% in late March before making a partial comeback. 

Make no mistake about it, Mastercard will continue to feel the pain from the COVID-19 outbreak and its aftermath for a while to come. People without jobs aren't going to spend as much. It will probably take a long time before travel and tourism return to normal. All of this translates to lower volumes on Mastercard's payment processing network.

The company has already acknowledged the COVID-19 impact to some extent. A few weeks ago, Mastercard lowered its first-quarter revenue growth outlook and withdrew its guidance for full-year 2020. 

I'm confident, though, that the current crisis will pass, the economy will recover, and Mastercard will shine. The company directly benefits from the "war on cash" -- the trend of consumer switching from physical payment methods to electronic payment. My view is that this "war" will intensify and that Mastercard will emerge as a huge winner from it. Now is a great time to scoop up shares of this well-run, highly profitable payment leader.