Last year, economic headwinds hit the stock market like a wrecking ball, and the results were downright devastating for many investors. The S&P 500, the Dow Jones Industrial Average, and the Nasdaq Composite dropped into a bear market as Wall Street reacted to runaway inflation and rising interest rates. In fact, all three indexes suffered their sharpest declines since the financial crisis of 2008.

Unfortunately, the situation may get worse before it gets better. Inflation is still hovering near a four-decade high, and central bank officials expect interest rates to continue climbing this year. Those forces could tip the U.S. economy into a recession, and that possibility will probably keep the stock market suppressed in the near term.

However, patient investors can find solace in one undeniable truth: Every past bear market has eventually ended in a new bull market, and there is no reason to believe the current drawdown is anything out of the ordinary. That means the next bull market is on its way.

In the meantime, investors should consider this advice from Warren Buffett.

A bull bucking its head in front of numbers and a bar chart.

Image source: Getty Images.

Widespread fear creates buying opportunities

Buffett discussed major stock market declines in Berkshire Hathaway's 2016 letter to shareholders, and one comment jumps off the page: "Widespread fear is your friend as an investor, because it serves up bargain purchases."

Those words are quite relevant today. Many stocks that are brimming with future potential have fallen sharply on recession fears, but economic downturns are a temporary phenomenon with little bearing on the long-term growth trajectory of a quality business. That means obsessing over the possibility of a recession is a waste of time. Investors should ignore the short-term noise and, instead, ask themselves which businesses will be better off a decade down the road. Buying stock in those businesses today will almost certainly produce a positive result in the long run.

It's worth mentioning that Buffett follows his own advice. Berkshire Hathaway invested $66 billion in stocks through the first three quarters of 2022, which is more than the company invested during the previous three years combined.

The secret to making money in the stock market

Buffett once summarized the secret to making money in the stock market in a single sentence: "All there is to investing is picking good stocks at good times and staying with them as long as they remain good companies."

Right now is undoubtedly a good time to invest; many wonderful stocks are trading at bargain prices. But that knowledge is only half the battle. After identifying a good stock -- a business with a durable competitive advantage and a large market opportunity -- investors must commit to holding that stock through thick and thin, provided their investment thesis remains intact.

Why? No one knows the future, so attempting to time the market is tantamount to gambling. Countless variables can affect a stock's price in the short term, some of which are unrelated to the stock, but the financial performance of the underlying business is the only variable that matters in the long run. In other words, a long-term mindset eliminates the short-term noise. That means investors who correctly identify good stocks and stick with them are bound to benefit.

Of course, it is easy to be a long-term investor when stock prices are rising, but it takes more discipline when prices are falling. That's why investors should consider this insight from Buffett when they are tempted to stray from a buy-and-hold strategy: "The stock market is designed to transfer money from the active to the patient."

The most sensible way to invest in the stock market

According to Buffett, an S&P 500 index fund is the most sensible way for the average investor to gain exposure to the stock market. He once explained his rationale like this: "American business -- and consequently a basket of stocks -- is virtually certain to be worth far more in the years ahead."

The S&P 500 is an index composed of 500 of the largest American businesses, including value stocks and growth stocks from all 11 market sectors. Given its scope and diversity, the S&P 500 is widely recognized as a benchmark for the broader U.S. economy, and an S&P 500 index fund allows investors to spread capital across a basket of blue chip American businesses.