Investing in the stock market is one of the best ways to build wealth over time, but choosing the right investments is key. That can sometimes be easier said than done, however, especially during periods of volatility. When the market is shaky, it can be challenging to ensure you're investing in stocks that have the potential to weather the storm.

Warren Buffett is one of the most famous and successful investors of all time, so when he gives advice about stock picking, it pays to listen. Here's what he has to say about choosing the right investments.

Warren Buffett wearing a suit and looking at the camera.

Image source: The Motley Fool.

Focus on the business, not the stock

In the most recent Berkshire Hathaway annual shareholder letter, Buffett shared some insight into how he chooses stocks. In the letter, he emphasizes that he and business partner Charlie Munger focus on quality businesses.

"We own stocks based upon our expectations about their long-term business performance and not because we view them as vehicles for timely market moves," Buffett explained. He also added that, "Charlie and I are not stock-pickers; we are business-pickers."

Choosing the right businesses is key to successful investing. Some stocks may see explosive returns, but if the companies themselves aren't fundamentally solid, that growth likely won't last long.

By investing in strong businesses, though, you're more likely to see consistent growth. This strategy can take more time to see significant results, as healthy companies generally don't earn massive returns overnight. However, it's much safer than short-term trading, and you're also less likely to lose money.

Investing for the long term

As you're choosing investments, keep in mind Buffett's advice to be a "business-picker." While it's important to study factors like the stock's price and historic returns, be sure you're also looking at the business as a whole.

Consider factors like whether the company has a competitive advantage in its industry, for example, and what its leadership team looks like. Digging into the company's financials can also help you determine whether the business is growing or struggling.

Also, be prepared to hold your investments for at least a few years, if not decades. Even the best stocks have bad years, especially if the market is volatile. Over time, though, the good years should outweigh the bad ones, and you're more likely to earn positive average returns.

Choosing the right stocks is critical to building wealth in the stock market, but it's even more important to choose the right businesses. By investing in companies with strong fundamentals and long-term potential, you'll be on your way to generating wealth in the stock market.