Volatility is back in the stock market as we approach the final quarter of 2021. Those swinging indexes are a reminder that stock prices often wiggle, sometimes crash and/or rally, but march higher over the long term at a rate that can generate wealth for patient shareholders.

One of the hardest aspects of that simple process is holding your shares through the good times and the bad. Selling too soon is a great way to ensure underperformance.

So let's consider a few stocks that aren't likely to tempt you into selling due to a bad quarter. These are strong companies at attractive valuations -- stocks that can grow through a wide range of market conditions.

We're going to take a closer look at Procter & Gamble (PG 0.60%), Walmart (WMT -1.75%), and Constellation Brands (STZ 0.74%).

A mother and daughter play in the laundry room.

Image source: Getty Images.

1. Procter & Gamble

Procter & Gamble has earned its reputation as one of the market's most dependable blue-chip stocks. With Tide detergent, Pampers diapers, Crest toothpaste, and other products, the consumer staples giant dominates dozens of niches with brands that are used by millions of people every day.

But did you know that P&G stock has trailed the market by a wide margin in the past five years despite improving financials and growth? The stock hasn't participated in this year's rally, for example, despite posting industry-leading organic sales gains.

Yes, growth is slowing in 2021 after shoppers packed their pantries through most of 2020. P&G is also facing higher costs on everything from shipping to raw materials. But the company chooses to compete in only the most attractive industry niches, places where its innovative product releases can drive profitable growth. Those advantages should help this bargain stock outperform the market while protecting investors from that wild volatility.

2. Walmart

Walmart is another consumer staples giant that needs no introduction. With over $550 billion of annual sales, the world's leading retailer is famous for good reason.

Yet a Walmart investment delivers more than just stable earnings growth and rising dividend income. The chain is making bold bets in attractive areas like digital advertising and data monetization. Its $75 billion in annual e-commerce revenue makes it a huge player in that growth sector, too.

Walmart is also an expert at directing capital toward high-return investments. Today, that focus is on improving the supply chain and its omnichannel selling platform. While the cash outlay might pressure earnings over the short term, it is laying the groundwork for more years of industry dominance for this Dividend Aristocrat.

3. Constellation Brands

Constellation Brands was a Wall Street favorite before the company's portfolio reboot depressed earnings. The process of shedding underperforming wine and spirits brands has clouded its profit outlook and detracted from an otherwise strong business.

But it might be time to take another look at this premium alcoholic beverage company. Constellation Brands has been steadily winning share in the beer division. And while conditions are worsening in the hard seltzer niche, growth is still booming for premium imported beer brands like Corona, Modelo, and Pacifico.

A Constellation Brands investment also carries with it exposure to the growing, recreational marijuana industry through its sizable interest in Canopy Growth, a Canadian cannabis company.

Investors might need to sit through perhaps another period of weak earnings along the way, but that's a small price to pay for market-thumping, long-term returns.