The stock market is reaching fresh all-time highs on an almost daily basis right now. Some investors expect the good times to keep on rolling in 2020 while others expect a drastic downturn someday soon.

My crystal ball is in for repairs, so I don't know exactly when the next market crash is coming, but I do know that there will be downturns in the future. Corrections and calamities may be unpredictable in many ways, except for the fact that they keep showing up when they're least expected. You and I can't do anything to stop it, but we can prepare our portfolios for the next inevitable crash.

First, it's a good idea to keep some spare cash in your long-term investment portfolio. Without some dry powder on hand, you won't be able to take advantage of low buy-in prices on high-quality companies after the next big drop. Then, you should invest in a handful of recession-proof stocks ahead of time in order to keep your portfolio stable when the storm winds start to blow. Read on to see how Walmart (WMT 1.01%), American Water Works (AWK 1.25%), and Amazon.com (AMZN 2.09%) can help you make the best of the upcoming market crash -- whenever it might appear.

A professionally dressed man wielding a sword, taking a defensive stance behind his shield.

Image source: Getty Images.

Discount retail on a massive scale

Retail giant Walmart never really suffered in the meltdown of 2008. Let's say you owned $10,00 in Walmart stock at the start of 2008. Two years later, that holding was worth $11,250 -- and on the worst day of the entire downturn, the stock held firm with a total drop of just 0.3%. Over the same period, the S&P 500 index had plunged 53% lower.

Consumers tend to tighten their purse strings when times are hard. That's bad news for retailers on the discretionary side of the fence, while low-cost vendors of staples you can't live without can benefit from that trend. Among the best-performing retail stocks in the 2008-2009 time span, you'll find a handful of deep-discount dollar stores next to well-run chains that took advantage of their economies of scale. Walmart was one of those big names with deep pockets, and the company still meets that description a decade later.

This company isn't likely to suffer much in the next market meltdown either. The company is a veritable cash machine, producing $25 billion of operating cash flows over the last four quarters and sitting on a cash reserve of $8.6 billion. That financial stability sets Walmart up as a great defensive play.

Dripping with dividends

American Water Works is the largest publicly traded water utilities in the country. The company operates in a tightly regulated market, providing water and waste-water services to the public at regulated rates. American Water also offers water-related support services to the U.S. military.

The regulatory oversight puts a cap on this company's potential top-line growth, but it also ensures that the business can grow at a moderate pace for years and even decades without having to worry much about competition. So American Water enjoys a smoothly rising revenue line, generating tons of cash along the way, and using that cash to fuel a generous dividend policy. Together, these business trends paint a very pretty picture:

AWK Revenue (TTM) Chart

AWK Revenue (TTM) data by YCharts

How did this stock fare in the 2008 crash? American Water Works actually followed Walmart's trajectory almost to a T, except that the stock wasn't available to buy at the start of 2018. By the end of 2009, a $10,000 investment in its April 2008 IPO had grown to $10,880. And that's not all. Holding on to those shares for another decade would have given you an investment worth $59,640 today. A $10,000 Walmart investment made on the same day would be worth $23,270 now, and an S&P 500 index fund would have stopped at $21,080.

The best defense is a good offense

I see Amazon as a fantastic defensive play ahead of the next large-scale market crash. This is neither a typo nor a mistake.

Sure, the e-commerce giant took a big hit in the 2008 crash. Share prices dipped as much as 39% lower before the rebound began.

But Amazon turned out to have a good thing going with its low-cost retail model, even if consumers weren't quite as comfortable with online orders as they are today. The Amazon Prime free shipping program had been around for a couple of years but was rarely found in the wild in 2008. The company showed a strong hand in the first few earnings reports after the market meltdown, then blew out every expectation with a tremendous third-quarter report in 2009. By the end of the year, a $10,000 Amazon investment had grown to $14,520.

One might argue that the market crisis accelerated Amazon's growth while holding back many of its competitors. The company's disruptive e-commerce business got plenty of spotlight and column inches of valuable attention, spreading the word that this online bookstore actually sells a lot more than books.

Amazon doesn't need that kind of marketing help anymore. Everyone knows what this online retailer is about, and investors have pocketed tons of wealth as Amazon grew into one of the largest businesses on the planet. That hypothetical $10,000 investment from early January 2008, would be worth $202,100 today. The speed bump in 2008 hardly even slowed this juggernaut down in the long run. And the beat goes on -- Amazon remains a great buy in 2020.