Investors have been on edge in recent months, wondering if the U.S. could be headed for another recession.

In case you haven't heard, there's a trade war with China. And the yield curve inverted in August, a recessionary sign that had people Googling the term "recession" like it was 2008. And there is the seemingly continual reminder that this economic expansion is the longest in U.S. history.

If all that makes you worry, here are three things you can do that could help, whether the next recession comes in a month, a year, or five years: Review your holdings and consider whether recession-resistant stocks need to be part of them; consider some key questions about how much cash you want in your portfolio; and make sure your all-important emergency fund is in good shape. This kind of preparation can help you avoid one of the biggest pitfalls investors face -- panic.

Stormy clouds with lightning flash above a yellow road sign with the words economic uncertainty ahead.

Image source: Getty Images.

Consider recession-resistant stocks

Generally a recession is considered to be at least two consecutive quarters of declining gross domestic product (GDP) in the United States, although the National Bureau of Economic Research uses this definition: "A significant decline in economic activity spread across the economy, lasting more than a few months, normally visible in real GDP, real income, employment, industrial production, and wholesale-retail sales."

The first step to preparing your portfolio for this decline is knowing what's in your portfolio. Yes, it sounds basic, but it's an important process. If you have stocks, bonds, mutual funds, real estate, or cash, know how every holding fits into your overall goals.

Let's focus briefly on stocks. A quick review of a company's financial statements could provide insight into how a company might withstand a recession.

  • Check how much cash the company has available and how much debt it's carrying. (You can find this information on the balance sheet.) If a company's revenue suddenly declines in a recession, debt payments can become much more difficult. That's why having cash is so important. It can help a company make it through the rough times, whether it's used to pay debt or operating costs.
  • Check the company's earnings. (You can find this information on the income statement.) Some companies have long track records of profitability. They may not be growing revenue or earnings quickly, but they're reliable profit producers and may even pay a dividend. Companies that aren't yet profitable will likely suffer in a recession if their revenue growth slows or declines.
  • Check how much cash the company is producing. (You can find this information on the cash flow statement.) Companies can be profitable, but can be burning through cash at the same time. The cash flow statement will show you how much cash the company is producing through its operations. Negative cash flow is a warning sign.

After reviewing the companies, consider if your portfolio needs some (or more) steady, dividend-paying stocks. They may not be flashy, but they can be effective.

Consumer staples stocks are a good place to start. These are household goods that people need during good times and bad. An example is Walmart, a company that sells groceries (people have to eat during a recession) and other household goods for low prices, which is especially important when people are trying to save money during an economic downturn. How did Walmart fare during the last recession? Well, in the five months from May 15, to Oct. 15, 2008, the S&P 500 index lost 36% of its value, according to Yahoo! Finance. By comparison, Walmart was down 12%.

If you're searching for recession-withstanding ideas, take a look at the Dividend Aristocrats, companies that have raised their dividends for at least 25 consecutive years. You'll see some recognizable names, including AT&T, Coca-Cola, Pepsi, Johnson & Johnson, McDonald's, and Walmart.

How much cash? Consider your situation, not the market's direction

It never hurts to have cash when the market drops and your favorite companies are suddenly on sale; but there are important questions to consider about how much cash or low-risk, low-return investments you want  in your portfolio. If fear of a recession is driving your decision to increase cash, it shouldn't. Consider these questions instead: 

How soon do you need the money?

If you'll need this money in the next three to five years, it shouldn't be aggressively invested. If that money is in the market and there's an extreme downturn -- like the 50% plunge a decade ago in the financial crisis -- it could take several years to recover those losses.

If your time horizon is more than five years, you can recover those losses and should be reassured by the fact that the market has always bounced back. Here's an example: In early 2016 the market tumbled more than 10% in about six weeks, and fears of a recession were rising. If you had sold some of your investments and put that money in cash, you would have missed out on growth. The market quickly recovered, and the S&P 500 is up more than 55% since March 1, 2016. Having money on the sidelines comes with the opportunity cost of missing potential gains.

Are you trying to time the market? 

Trying to guess when a recession will happen or the short-term direction of the market is virtually impossible. It has eluded even the world's greatest investor, Warren Buffett, who said he knows of "no way to reliably predict market movements."

Buffett has always invested with a long-term view and made purchases based on a company's value, not because he was gauging the market's direction. Buffett keeps cash available and has been building that cash stash in recent years. (Berkshire Hathaway had more than $125 billion in cash and short-term investments on the balance sheet in its most recent quarter.)

Having cash can make sense, and it's important to consider what's best for your individual situation. While considering that, it's also important to repeat Buffett's point: Don't build cash simply because you're trying to time the market's next move. 

Do you have a watch list?

Having cash available is nice when that inevitable market drop occurs, but controlling emotions and exercising discipline can be difficult in that environment. It's not easy to be a buyer when negativity is rampant and there's no end in sight for the drop.

How do you prepare for that? Having a strategy before a market decline can help reduce the distress of watching your portfolio's value drop. For some, panic can cause selling at the worst time, but for Buffett it's the opposite: "Widespread fear is your friend as an investor because it serves up bargain purchases," he has said.

Creating a watch list can help you prepare for those moments. By researching in advance and identifying companies with strong leadership and long-term growth prospects, you will prepare yourself for an opportunity to buy at a lower price. 

Make sure you have an emergency fund

An emergency fund is imperative, especially if you think a recession is looming. Financial experts offer different advice about how much to save, but six months of living expenses is generally a good rule of thumb. An emergency fund calculator could help you determine how much you need.

That money should not be in the stock market or at risk. It should be quickly accessible in the unfortunate event that a recession leads to job loss. (Click this link to find some helpful information from The Ascent about an emergency fund.)

Final thought: Be prepared

It's important to understand that recessions are inevitable. Since 1945, the United States has had 11 recessions, and they lasted an average of about 11 months, according to the National Bureau of Economic Research. There will be another someday.

Whether that day is tomorrow, or in 2020, or in some year beyond, is unknown. What is known is that preparation can help you overcome what may be the biggest investment hurdle you'll ever face: you. Consider this excerpt from The Motley Fool Investment Guide, written by Motley Fool co-founders David and Tom Gardner:

As we've warned over the years, you are your own worst enemy. ... That's because successful investing has far more to do with how you act than with what you know.

When that inevitable market decline occurs, and there's an urge to sell at what may be the worst possible moment, preparation can help keep emotions in check. It also helps to remember that after every recession -- from the Great Depression nearly a century ago to the Great Recession a decade ago -- the market has recovered.

Quality companies survive recessions and often come out stronger. Prepared investors can benefit from that.