It's Halloween. And the scariest thing around isn't a haunted house or trick-or-treaters; it's the stock market. 

Many investors are afraid. They've seen their portfolios sink like a brick this year. Several of the biggest companies reported dismal quarterly updates in recent days. 

Some argue that buying stocks sooner rather than later is the smart thing to do. Others maintain that the worst is yet to come, especially with a potential recession looming. Should you buy stocks right now? Here's Warren Buffett's advice.

Warren Buffett with people in the background.

Image source: The Motley Fool.

Don't let the bear market scare you away

Buffett wrote in his 1986 letter to Berkshire Hathaway (BRK.A 0.58%) (BRK.B 0.38%) shareholders that he tries to "be fearful when others are greedy and to be greedy only when others are fearful." He absolutely wouldn't recommend that you let the current bear market scare you away from investing.

One key reason behind Buffett's view is that bear markets present great opportunities to buy stocks at attractive prices. In 2018, he stated in an interview with CNBC, "The best chance to deploy capital is when things are going down." The iconic investor wrote in his 2008 letter to Berkshire shareholders, "Whether we're talking about socks or stocks, I like buying quality merchandise when it is marked down." 

You might be tempted, though, to wait to try to buy stocks at even lower prices than you can get now. Buffett would almost certainly push back against that approach. In a speech he gave at Columbia University in 2009, he said, "Don't pass up something that's attractive today because you think you will find something better tomorrow."

It's also prudent to heed Buffett's warning about clinging to cash. He once stated, "Today people who hold cash equivalents feel comfortable. They shouldn't. They have opted for a terrible long-term asset, one that pays virtually nothing and is certain to depreciate in value." Those are especially applicable words in today's high-inflation environment.

What to buy

Depending on your background and motivation, Buffett actually might advise you not to buy individual stocks. Instead, he could recommend an S&P 500 index fund such as the SPDR S&P 500 ETF Trust (SPY 0.66%) or the Vanguard 500 Index Fund ETF (VOO 0.68%) (both of which are in Berkshire's portfolio). In Berkshire Hathaway's 2020 shareholder meeting, Buffett stated, "In my view, for most people, the best thing is to do is owning the S&P 500 index fund." 

What's the advice for investors who are willing to put in the time and effort to research individual stocks? Buffett would probably first emphasize focusing on the business rather than the stock itself. In his 2021 letter to Berkshire shareholders, Buffett wrote that he and his longtime business partner Charlie Munger "are not stock-pickers; we are business-pickers." 

The legendary investor fully believes in evaluating a company's competitive advantages. He stated in the past, "The key to investing is not assessing how much an industry is going to affect society, or how much it will grow, but rather determining the competitive advantage of any given company and, above all, the durability of that advantage."

Of course, Buffett also thinks valuations are important. He once said, "For the investor, a too-high purchase price for the stock of an excellent company can undo the effects of a subsequent decade of favorable business developments."

Practicing what he preaches

Buffett definitely practices what he preaches. He hasn't let the bear market scare him away. The multibillionaire has led Berkshire to buy multiple stocks during the market downturn this year. Two stocks that he's almost certainly continuing to buy in Q4 are Berkshire Hathway itself and Occidental Petroleum (OXY -0.02%).

Both of these companies represent businesses that Buffett understands well. He knows their competitive advantages. He's comfortable with their valuations.

It's probably safe to say that Buffett wouldn't recommend that investors copy his every move. Of course, he no doubt wouldn't mind having more people scoop up Berkshire shares. 

However, Buffett would likely urge investors who are interested in individual stocks to follow his lead in focusing on owning well-run businesses that are available at attractive prices. And he'd perhaps add something he's said before, "If a business does well, the stock eventually follows."