Warren Buffett has lived through 26 periods where the S&P 500 was in a bear market. Eleven of them came after he first invested in Berkshire Hathaway (BRK.A -0.28%) (BRK.B -0.08%) in 1965.

The legendary investor has led Berkshire to trounce the market during the past 57 years. His decisions made during major downturns made a big difference in his overall performance. Here's what Buffett does in bear markets -- and you should too.

1. Don't be afraid

One of Buffett's most famous quotes is: "Be fearful when others are greedy and be greedy when others are fearful." During bear markets, many investors are fearful. But that's exactly the time when Buffett isn't afraid at all.

In 2008 and 2009, the stock market reeled as the U.S. economy experienced what would be called the Great Recession. Anyone who lived through this time knows how scary it was for most investors.

However, Buffett wrote in his annual letter to Berkshire Hathaway shareholders after the dust settled, "It's been an ideal period for investors: A climate of fear is their best friend." That's almost certainly still his view during the current bear market. 

2. Put your money to work

In that shareholder letter, Buffett also wrote, "We've put a lot of money to work during the chaos of the last two years." He wasn't exaggerating. 

At the beginning of 2008, Berkshire's cash position stood at $44.3 billion. Over the next two years, the company retained operating earnings of around $17 billion. But Berkshire finished 2009 with a cash stockpile of $30.6 billion. Buffett practiced what he preached by being greedy when others were fearful. 

Guess what the multibillionaire is doing in this bear market? Putting Berkshire's money to work. So far in 2022, Buffett and his investment managers have bought 16 stocks. He's especially loaded up on shares of Occidental Petroleum (OXY -2.68%). Berkshire now owns a 17.4% stake in the oil and gas company. Oxy has been a big winner, with its shares more than doubling year to date.

One common denominator in all the stocks that Buffett buys is that he looks for high-quality businesses at an attractive price. As he wrote in early 2009, "Whether we're talking about socks or stocks, I like buying quality merchandise when it is marked down."

That's a smart approach for all investors. Most stocks are available right now at a discount to their prices last year. However, not all of them have quality underlying businesses.

3. Think long-term

Regardless of what the economy or the stock market is doing, Buffett always maintains a long-term perspective. During the dark period in the midst of the Great Recession, he wrote to Berkshire shareholders:

Amid this bad news, however, never forget that our country has faced far worse travails in the past... America has had no shortage of challenges.

Without fail, however, we've overcome them. In the face of those obstacles -- and many others -- the real standard of living for Americans improved nearly seven-fold during the 1900s, while the Dow Jones Industrials rose from 66 to 11,497. Compare the record of this period with the dozens of centuries during which humans secured only tiny gains, if any, in how they lived. Though the path has not been smooth, our economic system has worked extraordinarily well over time. It has unleashed human potential as no other system has, and it will continue to do so. America's best days lie ahead.

The current state of affairs isn't nearly as bad as it was in 2008 and 2009. This bear market presents a huge opportunity for long-term investors who aren't afraid to put their money to work.