After a long and tumultuous year, many investors are feeling drained by all of the stock market's ups and downs. Unfortunately, more volatility could be on the horizon if we're headed toward a recession.

To be clear, nobody knows for certain whether a recession is coming or not. But if an economic downturn is on the horizon, it's wise to start preparing now.

While there's no single right way to invest, there are a few tried-and-true tips that can help protect your money during a recession. Here's legendary investor Warren Buffett's advice.

1. Keep a long-term outlook

When we're in the thick of a downturn, it can seem never-ending. But even the worst recessions are only temporary.

The dot-com bubble burst holds the record for the longest bear market, at around 2.5 years. During the Great Recession, the bear market lasted just under 1.5 years. While those years were undoubtedly difficult for investors, those who rode out the storms were rewarded with record-breaking bull markets afterward.

Warren Buffett speaking to reporters.

Image source: The Motley Fool.

In a 2008 opinion piece for The New York Times, Warren Buffett emphasized the importance of keeping a long-term outlook:

A simple rule dictates my buying: Be fearful when others are greedy, and be greedy when others are fearful. And most certainly, fear is now widespread, gripping even seasoned investors. But fears regarding the long-term prosperity of the nation's many sound companies make no sense. These businesses will indeed suffer earnings hiccups, as they always have. But most major companies will be setting new profit records 5, 10 and 20 years from now.

2. Don't wait too long to invest

Though it may not seem like it, right now is one of the best investing opportunities of the year. Stocks across the board have seen their prices plunge, making it a fantastic time to load up on quality investments at a steep discount.

It can be tempting to wait until the market shows some signs of recovery before you buy. But if you take that route, you could miss out on substantial earnings. As Buffet wrote in the Times article:

I haven't the faintest idea as to whether stocks will be higher or lower a month or a year from now. What is likely, however, is that the market will move higher, perhaps substantially so, well before either sentiment or the economy turns up. So if you wait for the robins, spring will be over.

The stock market can be unpredictable, and nobody knows exactly when a bear market will bottom out. The best thing you can do, then, is invest consistently throughout a downturn to take advantage of the upswing -- whenever it arrives.

3. Focus on quality businesses

The key to ensuring your investments survive a recession is to buy strong stocks, and the strongest stocks come from the healthiest companies.

During a downturn, many stocks will see their prices fall. But if a company has solid underlying business fundamentals -- like a competent leadership team and solid financials -- it's far more likely to rebound when the market recovers.

In Berkshire Hathaway's 2021 letter to shareholders, Buffett explained that he and business partner Charlie Munger "own stocks based upon our expectations about their long-term business performance and not because we view them as vehicles for timely market moves."

"That point is crucial," he continued. "Charlie and I are not stock-pickers; we are business-pickers."

The more of these businesses you have in your portfolio, the better your chances of thriving after a recession. By investing in these types of stocks now and holding them for the long term, you'll be prepared for whatever the future has in store.