The economy doesn't always go up; recessions occur when the economy contracts, which can have real-world consequences for consumers, businesses, and the stock market. Despite recession talk ramping up in the media, nobody knows when the next recession will happen or how severe it will be. Investors can prepare their portfolios by looking for stocks with a proven long-term growth history.

Dividend stocks are great for this. Companies that have raised their dividends for the past 25 consecutive years have done well enough to continue paying shareholders more despite recessions following the dot-com bubble, the financial crisis, and the height of the COVID-19 pandemic.

Only high-quality companies with durable competitive advantages, prudent management teams, and healthy fundamentals can pull that off.

Here are three stocks from that group that investors can count on during thick and thin.

1. RTX

Some industries may slow when the economy lags, but defense and aerospace seldom stop moving. RTX (RTX 0.70%) is a leader in both sectors. The company was formed after a recent merger, joining Raytheon with United Technologies and creating a three-headed conglomerate. RTX's core business includes building aviation systems for private and military applications, jet engines for commercial and military aviation, and various defense and weapons systems for the military. Large mergers sometimes backfire, but RTX remains in solid financial shape with an investment-grade credit rating.

RTX has a 31-year dividend growth streak that should continue for years. RTX will pay $2.52 per share in dividends this year, less than half the $5.44 analysts believe the company will earn. Additionally, those earnings are poised to grow by more than 10% annually for the next three to five years. Investors can enjoy a solid 2.1% starting yield and reasonably expect double-digit increases.

Remember that defense and aviation are highly regulated industries with steady demand. The COVID-19 pandemic was an unprecedented event that virtually halted the aviation industry. It's the only time RTX's annual revenue dropped 15% or more in decades. And yet RTX still raised the dividend. Investors can feel confident holding this diversified dividend stock with long-term growth potential.

2. Sherwin-Williams

Paints and coatings are remarkably simple products that generate recurring sales from new buildings, home construction, and renovations. Sherwin-Williams (SHW 0.64%) leads the industry and is a dividend rock star with an active dividend growth streak spanning 46 years. There isn't much proprietary about paint, but Sherwin-Williams boasts a strong brand that resonates with DIY and building professionals alike. Sherwin-Williams sells its products through company-owned stores, retail stores, and distributors. It's a boring business, but it has staying power; paints and coatings will probably never become obsolete.

Investors won't find a colossal starting yield here; Sherwin-Williams only yields 0.8%. However, the stock's rapid price appreciation helps make up for it. Shares have outrun the S&P 500 over the past decade. The dividend is only a quarter of the company's estimated 2024 earnings, so there is much room for future dividend raises that will easily outpace inflation.

Sherwin-Williams is very consistent; annual revenue has only dropped more than 10% once since the early 1990s. Investors looking for growth should consider Sherwin-Williams a dynamite compounder with room to raise its dividend dramatically over the coming decade and beyond.

3. NextEra Energy

Renewable energy has been growing steadily for decades, and leading renewable energy company NextEra Energy (NEE 0.04%) has been a big winner. It operates wind and solar energy products, energy storage, and America's largest electric utility, Florida Power & Light. The company issues debt and stock to fund its energy projects, but management generates enough investment returns to make a profit and pay investors dividends. NextEra's growth and dividends have generated market-crushing total stock returns since the 1980s despite doubling its share count.

The company has raised its dividend for 31 consecutive years. Investors will receive $2.06 this year for each share they own, roughly 65% of NextEra's expected earnings per share. Investors shouldn't worry about management continuing to cut those dividend checks; NextEra's utility business is virtually recession-proof since people always need electricity, and renewable energy is only getting bigger.

Today, wind and solar energy still only contribute 13% of America's total electricity, but that number is poised to increase. That rising tide will impact all renewable energy companies, but NextEra's title as the world's leading producer almost ensures the company will continue growing well into the future.