Last year was a catastrophe for many investors. Red-hot inflation and rising interest rates triggered a sharp decline in the stock market, erasing more than $8 trillion in value from the S&P 500 index alone. In fact, all three major U.S. financial indexes had their worst year since the global financial crisis rocked Wall Street in 2008.

Unfortunately, the situation has changed little in the first two months of 2023. The benchmark S&P 500 is still down over 15% from its all-time high, and investors have good reason to worry that stocks could fall even further. Inflation is still near a 40-year high, the federal funds rate is at a 15-year high, and several economic signals suggest a recession is possible, if not probable. Those concerns raise the question: Is it safe to invest in the stock market right now?

Investors should take advice from Warren Buffett.

An person in a suit looks into the distance while holding a newspaper.

Image source: Getty Images.

Widespread fear serves up bargains

The seeds of the global financial crisis were planted in the early 2000s. Years of lax lending standards and low interest rates led to the creation of a housing bubble, as subprime borrowers were saddled with debt they couldn't afford. When the bubble collapsed and mortgage delinquency rates soared, the so-called subprime mortgage crisis rattled financial institutions around the world, peaking with the bankruptcy of Lehman Brothers in Sept. 2008, a top investment bank at the time.

By mid-October, the S&P 500 was down 40% and Wall Street was awash with fear, but Buffett chose that moment to publish an op-ed article in The New York Times. He first acknowledged the disastrous state of the financial world, and he warned investors the situation would likely get worse in the near term. But Buffett also said he'd been buying stocks, and he explained his rationale with this well-known quote: "A simple rule dictates my buying: Be fearful when others are greedy, and be greedy when others are fearful."

That sentiment is once again relevant today. High inflation and rising interest rates have sewn recession fears, and many investors have responded by selling stocks. But the selling has likely gone too far. It always does, simply because it is human nature to overreact. That means many stocks brimming with potential are currently trading at discounted prices. Or to borrow another quote from Buffett, "Widespread fear is your friend as an investor, because it serves up bargain purchases."

Temperament is more important than intellect

Buffett has a knack for picking great stocks. Since taking control of Berkshire Hathaway in 1965, his business acumen and investing insights have transformed the company into a $680 billion behemoth, and the stock has nearly doubled the performance of the S&P 500 under his leadership. At the same time, Buffett has amassed a personal fortune that exceeds $100 billion, making him one of the wealthiest people in the world. That type of success does not happen by accident, and those bona fides make Buffett's advice especially credible.

With that in mind, one often-overlooked Buffett quote is particularly relevant in the current market environment: "The most important quality for an investor is temperament, not intellect." Those words take on a deeper meaning when reconciled with another Buffett quote: "The stock market is designed to transfer money from the active to the patient."

Picking great stocks -- businesses backed by a durable competitive advantage -- is important, but it is only half of the equation. Successful investing also requires the right mindset. Investors must learn to think long-term. That means holding high-conviction stocks through periods of market volatility. As discussed, many investors have sold stocks to hedge against a possible recession, but those investors have made a grave miscalculation.  

Timing the market consistently is impossible, because no one knows the future. But investors who sell stocks in response to temporary economic headwinds are effectively betting on their ability to time the market twice: once when they cash out and again when they buy back into the market. But history says that strategy will fail.

In the last two decades, 84% of the S&P 500 index's best days took place during a bear market or during the first two months of a bull market (i.e., before it was clear the bear market had ended), and missing just a few of those days is one of the most costly mistakes an investor can make. Case in point: The S&P 500 increased 517% during the 20-year period that ended on Dec. 31, 2021, but if the 10 best days are removed the calculation, the index increased only 183%.

In summary, now is an excellent time to buy stocks, but that doesn't mean the market will rebound anytime soon. Again, no one knows the future, so the best course of action for investors is a long-term buy-and-hold strategy.