Bear markets don't feel good, but they have their silver linings; when the tide takes all ships (stocks) down, investors can get deals on proven winners that can generate solid investment returns. For example, consider one of Warren Buffett's favorites, The Coca-Cola Company (KO 0.78%). The stock has fallen 10% in the past month and 15% from its high.

The beverage giant has been a steady wealth-building machine for decades, and buying during shaky markets has historically proven to be a good idea. I'll show you where the stock stands today and where it goes from a solid deal to a table-pounding buy.

Coca-Cola's rare stumble

Investors generally view Coca-Cola as a safe stock. One might say that nobody gets fired for buying Coke. There's good reason for that. One of Warren Buffett's largest holdings, the stock has paid and raised a dividend for 60 consecutive years. You can visit a town in Florida called Quincy, which once became the wealthiest town per capita in the United States on the back of Coca-Cola stock.

Coca-Cola is a winner, and everyone knows it, which is why the stock is typically very resilient. The current drop of almost 15% from its high is the second-largest in a decade outside of the COVID-19 market crash in 2020:

KO Chart.

KO data by YCharts.

Coca-Cola is a solid deal if you're looking to buy a safe stock today. The stock's forward price-to-earnings ratio (P/E) is 23 versus its median of 26 over the past decade. Meanwhile, analysts are calling for 6% annual earnings-per-share (EPS) growth over the next three to five years, an uptick after the company grew EPS 1.5% annually over the past decade. Getting roughly 10% annualized total returns is nice, and Coca-Cola's dependability gets investors to pay that premium valuation for the stock.

Where the stock becomes a table-pounding buy

Coca-Cola has such a long history as a dividend stock that you can identify trends if you look back far enough. For example, you can see the company's dividend yield below for the past four decades. The stock's dividend yield has surpassed 3% and, as discussed above, is already at a modest discount to its 10-year median P/E ratio.

KO Dividend Yield Chart.

KO Dividend Yield data by YCharts.

But now and then, that dividend yield stretches to 3.5%. It's not often. The three instances are among the most violent bear markets in generations, including the bear market of 1987, the financial crisis in 2008-2009, and the COVID-19 Crash in 2020. In other words, getting a 3.5% yield from Coca-Cola stock typically takes stuff hitting the fan, but it's always been a great time to buy, in hindsight.

What's the magic number?

Long-term investors could buy shares today and let Coca-Cola's reliable dividend and modest growth slowly create wealth over the years and decades ahead. But Coca-Cola could be an even better investment if you snag shares at a 3.5% yield, which rarely happens. The company's annual dividend is $1.76, so a 3.5% yield would require shares to fall to about $50.29.

Of course, it's not certain that Coca-Cola will keep falling, and a dollar-cost averaging strategy can help you slowly build your investments over time. But emotions can also run high in a bear market. People can get caught waiting for prices to stop falling, only to miss the rebound because they don't trust it. Market timing is a lousy strategy, so prepare yourself for opportunities by identifying your target stocks and valuations. That way, if Mr. Market does put Coca-Cola at a deep sale price, you won't miss it.