Warren Buffett buying shares of undervalued quality companies and holding on for the long term has led Berkshire Hathaway to decades of market-beating performance. I'm talking about a compounded annual gain of more than 19% over 58 years compared to a compounded increase of a little more than 10% for the S&P 500 Index.

That's why investors look closely at Buffett's holdings from quarter to quarter and often try to follow his moves. And that's a smart idea -- even if you have a small amount to put into the stock market, you still can benefit from investing like Buffett. This doesn't mean you have to copy his every decision or that your portfolio should mimic Buffett's. Instead, you might choose a few key holdings or ideas that correspond to your own investing style. For instance, an interest in dividends may lead you to Buffett favorite Coca-Cola (KO -0.22%).

And speaking of the beverage powerhouse, it's one of two no-brainer Buffett stocks to buy right now so that you may potentially score a Buffett-like win down the road. Let's check out these magnificent long-term stocks.

Two friends drink soda on a boat.

Image source: Getty Images.

1. Coca-Cola

Buffett loves dividend stocks, and that's exactly why Coca-Cola has remained a top position in his portfolio for many years. Berkshire Hathaway wrapped up its purchase of 400 million shares of the world's biggest nonalcoholic beverage company back in 1994 -- and, at the time, received a dividend of $75 million. Thanks to annual increases by Coca-Cola, the dividend for the same number of shares grew to $704 million by 2022.

Even though most of us don't have Buffett's resources, by owning Coca-Cola, we can still generate an interesting level of passive income over time or even reinvest the dividend to increase our stake in the company. In either case, it's a winning situation.

Coca-Cola is likely to keep increasing its dividend for two reasons. First, Coca-Cola has boosted its annual dividend for more than 50 years, so rewarding shareholders is clearly important to the company. Second, with more than $10 billion in free cash flow, Coca-Cola has the financial strength to keep lifting payments.

The company pays an annual dividend of $1.94 per share, representing a dividend yield of 3.1% using the closing share price on June 18 -- and that's significantly higher than the S&P 500 yield.

KO Dividend Yield Chart

KO Dividend Yield data by YCharts.

On top of this, Coca-Cola has a long track record of earnings growth and a solid brand moat -- a competitive advantage that keeps consumers coming back (and makes it difficult for rivals to take market share).

Today, Coca-Cola trades for 22 times forward earnings estimates, down from more than 25 a couple of years ago. This offers you an opportunity to get in on this top passive income stock for a great price.

2. Amazon

Thanks to its portfolio managers, Berkshire Hathaway got in on Amazon (AMZN 2.19%) stock in 2019, and Buffett says he regretted not recognizing the opportunity sooner. As a technology company, Amazon may not be a classic Buffett business, as the billionaire doesn't invest heavily in tech.

But Buffett surely likes Amazon for key reasons that make it a fit for his investment strategy. The company has a solid track record of earnings growth and economic moats in both its e-commerce and cloud computing businesses, which should keep it in a strong position over time.

E-commerce moats include its Prime subscription program, extensive fulfillment network, and relationships it's already built with consumers around the world. As for cloud computing, Amazon Web Services (AWS) is the global leader and has been consistently in that top spot. In addition, AWS continues to invest in infrastructure to maintain its dominance.

All of this has helped Amazon grow earnings into the billions of dollars over time. The company's recent revamp of its cost structure should make processes even more efficient. This helped Amazon quickly recover after higher inflation weighed on earnings, and it should boost earnings potential during better economic times, too.

Amazon shares are reasonably priced for a company with leadership in two high-growth markets. Trading at 40 times forward earnings estimates, down from more than 50 late last year, they offer you an opportunity to, like Warren Buffett, buy a top company for a bargain.