In some ways, things are starting to look up for the U.S. economy. A promising inflation report and low unemployment have many people feeling optimistic that perhaps the worst of this downturn is over.

However, many Americans are still feeling the pinch, and a potential recession is still on the table. To be clear, we're not officially in a recession just yet. The National Bureau of Economic Research, the organization responsible for making that decision, hasn't made the official call so far.

Whether or not we'll face a recession later this year is uncertain. But if there's anyone who knows how to survive economic downturns, it's famed investor Warren Buffett. Here's his advice for getting through a recession.

Warren Buffett wearing a suit and tie looking at the camera.

Image source: The Motley Fool.

1. Keep a long-term outlook

Nobody knows for certain whether a recession is looming or how long it might last if it hits. But we do know that, over the long run, the economy and the stock market will recover.

Short-term volatility is normal, and there is a possibility that the economy could slow and stock prices might sink over the next few months. If that happens, your investments could lose value in the near term. However, even the worst recessions are only temporary, and things will get better over time.

Back in 2008, at the height of the Great Recession, Warren Buffett wrote an opinion piece for The New York Times. He explained that amid the recession, "businesses will indeed suffer earnings hiccups, as they always have. But most major companies will be setting new profit records five, 10, and 20 years from now."

2. Invest more

It can be daunting to continue investing when the future is uncertain, but right now is one of the best opportunities to buy more. 

While the market has been rebounding in recent weeks, stock prices, in general, are still well below their peaks from earlier this year. That means you have the chance to load up on quality stocks at a discount -- which can potentially save you a lot of money over time.

This strategy can also be incredibly profitable. When you invest during economic slumps, you're setting yourself up for significant returns when the market recovers. For example, in March 2009, the S&P 500 hit its low point during the Great Recession. But in the following year alone, it saw returns of nearly 70%.

^SPX Chart.

^SPX data by YCharts.

According to Buffett, an important rule to remember when investing is to "be fearful when others are greedy, and be greedy when others are fearful." If we face a full-blown recession and stock prices fall further, that is your opportunity to "be greedy" and invest as much as you can afford.

3. Focus on quality investments

The best way to ensure your investments survive a recession is to fill your portfolio with strong, long-term stocks. Not all businesses will make it through tough economic times, but healthy companies have the best chance of experiencing consistent growth despite volatility.

This is especially important to remember when stock prices are lower. It can be tempting sometimes to buy shaky stocks simply because they're on sale. But a bad investment is still a bad investment even if it's affordable. You're better off sticking to quality stocks that are more likely to rebound from slumps. As Buffett says, "It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price."

Nobody can say exactly how the market or the economy will perform over the coming months, and there's still a chance that we could face an official recession. No matter what happens, though, the right strategy (and the right investments) can keep your money as safe as possible.