I've got some good news and some bad news, and they're one and the same: A stock market crash is coming.

To be fair, we're never going to know ahead of time precisely when a crash will occur, how long it's going to last, or how steep the decline will be. But we do know that double-digit percentage declines have occurred for the S&P 500, on average, every 1.87 years since the beginning of 1950. We also know that a number of data points concur with the growing likelihood of a crash or steep correction.

But as noted, crashes are good news, too, because they allow investors to (hopefully) buy into high-quality stocks at a discount. When the next crash inevitably strikes, the following five industries should be bought by investors hand over fist.

A person circling and drawing an arrow to the bottom of a steep plunge in a stock chart.

Image source: Getty Images.

Cybersecurity stocks

While I wouldn't go so far as to call any industry or trend completely market-crash proof, cybersecurity stocks are pretty darn crash-resistant. That's because the security solutions they offer are going to be needed no matter how well or poorly the U.S. economy and stock market are performing. As data goes digital, the onus of protecting enterprise and consumer data will increasingly fall into the hands of third-party cybersecurity-service providers.

One name to keep an eye on here would be CrowdStrike Holdings (CRWD 0.14%). Though the company's valuation isn't exactly cheap, its premium is merited, given the success of its cloud-native security platform Falcon, which oversees 6 trillion events each week.

Leaning on artificial intelligence allows Falcon to become more efficient at recognizing and responding to threats over time. In many ways, cloud-native solutions like Falcon are more cost-efficient than on-premises security solutions.

What's more, approximately 98% of CrowdStrike's customers are sticking with its services, with nearly two-thirds of clients purchasing four or more cloud-module subscriptions. These add-on purchases are a big reason CrowdStrike has already hit its long-term subscription gross margin target so early in its existence. 

Multiple rows of electric meters on a panel.

Image source: Getty Images.

Electric-utility stocks

If you really want a safe bet during a stock market crash, consider putting your money to work in defensive electric-utility stocks. Demand for electricity at the residential and business level doesn't fluctuate much, which makes cash flow highly predictable.

The electric-utility stock that would make for a smart buy during a crash is NextEra Energy (NEE 0.34%), the largest utility by market cap in the United States. NextEra has set itself apart by making massive investments in renewable energy. It's devoted $50 billion to $55 billion for new infrastructure projects (mostly renewable) between 2020 and 2022 and already has the leading utility in the U.S. in terms of wind and solar capacity. These renewable sources have driven down electricity-generation costs and sent NextEra's compound annual growth rate to the high single digits in an industry known for low-single-digit growth.

It's also worth pointing out that NextEra's traditional utility operations (those not powered by wind, solar, or other renewable sources) are regulated, so the company must get approval from state public utility commissions before passing along price hikes. While this might sound like a pain, it keeps NextEra from being exposed to volatile wholesale electricity pricing. In other words, it's all about predictability.

A gloved processor using scissors to trim a cannabis flower.

Image source: Getty Images.

Cannabis stocks

Sticking with the concept of "going green," marijuana stocks are another smart avenue to consider during a stock market crash. During the pandemic, we saw consumers treat cannabis like any traditional consumer product. In short, they continued to buy pot no matter how bad things looked from an economic standpoint. This makes cannabis stocks a good bet to rebound quickly from any short-term downside.

One marijuana stock for investors to consider buying hand over fist during a crash is U.S. multistate operator Green Thumb Industries (GTBIF -1.37%). You'll definitely want to stick with U.S. pot stocks, considering that New Frontier Data's projection that U.S. weed sales could top $41 billion annually by 2025. Green Thumb has 59 operating dispensaries and 110 total retail licenses, with a presence in 13 states. It's expected to top $1 billion in annual sales next year and has already reached recurring profitability. 

What really makes Green Thumb interesting is its product breakdown. In the neighborhood of two-thirds of the company's sales are generated from derivatives, such as edibles, vapes, and oils. Derivatives are less prone to oversupply and sport considerably higher margins than dried cannabis. As long as Green Thumb keeps pushing these niche products, it'll remain an intriguing pot stock to own.

A dog seated on the center of a couch that's surrounded by its human family members.

Image source: Getty Images.

Pet stocks

Another surefire investment opportunity when the stock market crashes is pet stocks. According to data from the American Pet Products Association, year-over-year spending on companion animals in the U.S. hasn't fallen in over a quarter of a century.

This year, pet owners are expected to open their pocketbooks to the tune of an estimated $109.6 billion in spending. No short-term crash or correction is going to stop pet owners from spending big bucks on their four-legged family member(s).

A crash or steep correction would be a good time to scoop up shares of companion-animal health-insurance provider Trupanion (TRUP -1.39%), which ended March with almost 944,000 enrolled pets. Amazingly, this represents just 1% penetration of the U.S. companion animal market. If it were to reach a penetration rate of 25% in the U.S. (the same rate as the U.K.), we'd be talking about a $32.6 billion addressable market. For context, Trupanion brought in a little over $500 million in revenue in 2020.

Trupanion also offers competitive advantages. For instance, it's the only large-scale pet insurer that provides veterinary clinics with software capable of handling payment at the time of checkout. Plus, it doesn't hurt that the company has been building rapport with veterinarians and clinics for two decades.

A woman holding a credit card in her left hand while looking at an open laptop.

Image source: Getty Images.

E-commerce stocks

Lastly, it would be a smart idea to use a stock market crash or steep correction as an opportunity to put your money to work in e-commerce stocks. Consumers and businesses have been shifting their buying habits online for years. However, the pandemic really accelerated this trend. The percentage of discretionary and non-discretionary purchases from online sources is only going to increase over time, making e-commerce stocks a good bet to outperform.

The no-brainer buy here is Amazon (AMZN -1.14%). The kingpin of online commerce is projected to hold a 40.4% share of all U.S. online retail in 2021, according to an April report from eMarketer. The next-closest company is more than 33 percentage points back. And as the icing on the cake, Amazon has been able to use its leading position as the go-to online marketplace to sign up over 200 million people worldwide to a Prime membership.

Investors would also be wise not to overlook Amazon's second dominant business, Amazon Web Services (AWS). AWS brought in nearly a third of all global cloud infrastructure spending during the first quarter and is Amazon's ticket to rapidly growing cash flow through at least mid-decade.