Nervous investors worried about a recession will surely be preparing themselves for the worst right now. While it's far from clear that the global economy -- or even the U.S. -- will fall into a recession in the next few years, there are warning signs. It's quite possible that a major country like Germany could be in a recession (defined as two consecutive quarters of economic contraction) by the time you read this article. Moreover, history suggests the global economy will fall into recession at some point. What's a worried equity investor to do? Here are three suggestions.

How to invest during a recession 

The three ideas are as follows:

  • Buy stocks in an industry that is likely to do better in a recession -- this is where auto parts retailers like O'Reilly Automotive (NASDAQ:ORLY)AutoZone (NYSE:AZO) and Advance Auto Parts (NYSE:AAP) come in.
  • Invest in a sector whose prospects are largely independent of the economy, but whose stocks get sold off anyway -- this is where the healthcare sector comes in.
  • Park the money in cash and wait for an opportune time to buy-in. 
A bear roaring against a falling stock chart.

Image source: Getty Images.

Auto parts retailers

A quick look at the share-price charts of O'Reilly, AutoZone, and Advance Auto Parts in the two-year period straddling the last recession shows a significant outperformance. There's a reason for this, and it's the tendency for consumers to skip buying a new car in troubled times in favor of running older cars longer. That's good news for auto parts retailers because older cars need more servicing.

^SPX Chart

^SPX data by YCharts. Shaded areas correspond to recessions. 

As you can see below, that relationship appears to have continued in the last few years as U.S. retail car sales have passed a cyclical peak -- throw in a recession, and they are likely to decline further.

ORLY Revenue (TTM) Chart

ORLY Revenue (TTM) data by YCharts. TTM = trailing 12 months.

The sector looked like a good value at the start of 2018, and the three stocks had a great year. But are they still a good value, particularly with concerns over potential pressure on margin coming from (NASDAQ:AMZN).

The answer to the valuation question probably depends on whether there will be a recession and how long it will be. An extended period of economic decline will lead to employment instability and consequently falling car sales. Of the three, O'Reilly is probably best positioned to deal with the long-term threat from Amazon due its relatively higher share of its revenue from in-house repair revenue -- the company generates 43% of its revenue from professional mechanics (as opposed to DIY).

This is important because professional customers tend to need the parts immediately. And O'Reilly has arguably the best distribution system in the industry with 90% of its stores receiving what it says are "multiple same-day deliveries of hard-to-find parts" from its hubs. This is something Amazon will find very hard to replicate.

Healthcare is relatively recession-resistant

The qualifier is important! Despite its defensive nature, healthcare isn't entirely recession-proof. That said, three companies are well worth looking at. Animal health (for livestock and companion animals) is a specific area that shouldn't be significantly hurt by a recession. Indeed, Pfizer's former animal health businesses -- now spun off into a company called Zoetis (NYSE:ZTS) -- actually grew organic revenue during the last recession

Another exciting option in the healthcare sector is veterinary diagnostics company IDEXX Laboratories (NASDAQ:IDXX) -- a company that continues to grow profits at a double-digit rate

A third option, industrial company Danaher (NYSE:DHR), is actually more of a healthcare company these days. It's attractive because of its excellent management team and heavy exposure to life sciences, diagnostics, and water-quality treatment. Progress in 2019 has been excellent, and the addition of General Electric's biopharma business later this year will give management an opportunity to boost its growth rate. Danaher's best days are clearly ahead of it

Hold cash in reserve

History suggests that severe market dips are usually a good time for investors to start picking up stocks for the long-term. In this context, if you are worried about a recession causing a slump in asset classes such as equities then it's a good idea to keep some cash in reserve in order to take advantage of buying opportunities in your favorite stocks. 

Final thoughts 

All told, it's easy for investors to talk themselves into doomsday scenarios regarding the economy, and memories of 2008-2009 are still fresh. That said, if and when a recession occurs, history suggests the economy will revert back to growth soon enough. Nevertheless, if you want to try to protect yourself from a protracted slowdown, then the ideas suggested above are a good way to start.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.