The 2 things Warren Buffett calls 'the best protection against inflation'

Consumer prices are rising at their highest rate in more than a decade, stoking fears that inflation may be poised to wreak havoc>Stock picks and investing trends from CNBC Pro:

Meta is the worst performing FAANG stock this year. Here’s where Wall Street sees it going next

Goldman says Chinese stocks are too big to ignore — and names some top picks with serious upside

Goldman has a bunch of new stock picks, including Grab, Universal Music and more

Russia-Ukraine tension is a convenient excuse for the stock sell-off, but it's about more than that

He uses one of his own investments as an example: "If you own the Coca-Cola company, you will get a given portion of people's labor 20 years from now and 50 years from now for your product and it doesn't make any difference what's happened to the price level," because people will still pay for the products they like.

But rather than picking a single company to invest in, consider investing in low-cost index funds instead, which are far less risky. Buffett has long recommended that investors put their money in these funds, which hold every stock in an index, making them automatically diversified. The S&P 500, for example, includes big-name companies like Apple, Coca-Cola and Google.

Buffett previously told CNBC that for people looking to build their retirement savings, diversified index funds make "the most sense practically all of the time."

"Consistently buy an S&P 500 low-cost index fund," Buffett said in 2017. "Keep buying it through thick and thin, and especially through thin."