Most investors near the end of their working years are wise enough to avoid risky marijuana stocks. Unfortunately, recognizing relatively safe stocks that can help you build a giant nest egg isn't nearly as simple. 

UnitedHealth Group (NYSE:UNH), Moody's (NYSE:MCO), and Home Depot (NYSE:HD) are businesses built to thrive in good times and bad. Here's how they can help you build some retirement wealth.

Smiling man leaning back looking at stacks of coins arranged from shortest to tallest.

Image source: Getty Images.

UnitedHealth Group: Ahead of the curve

You may recognize UnitedHealth Group as the largest health insurer in the business, but did you know it's also the country's single largest employer of physicians? The company's OptumHealth segment employs, manages, or has contracts with 35,000 physicians who run dialysis clinics, outpatient surgery centers, walk-in clinics, and urgent care centers across the country. 

UnitedHealth also runs one of the country's largest pharmacy benefit managers, and its Optum Bank subsidiary processed $160 billion in payments to physicians last year. Other insurance companies are still paying third parties to handle pharmacy benefits and processing payments to doctors who don't work for them. This allows UnitedHealth to offer patients better care at competitive prices and still produce a larger profit than its peers.

There are a lot of ins and outs when it comes to the future of healthcare in America, but you can be sure that the company that provides good care at the lowest cost is going to come out on top. Right now that company may be UnitedHealth Group, and it's starting to show.

In 2018, revenue grew 12% to $226 billion, while earnings from operations rose 14% to $17.3 billion. The stock offers a measly 1.5% dividend yield, but you should know the company has raised its payout 2,900% over the past decade. A repeat performance could be a huge boost to your retirement savings.

Check out the latest earnings call transcripts for UnitedHealth, Moody's, and Home Depot.

Money stacks arranged from shortest to tallest.

Image source: Getty Images.

Home Depot: Fix up your portfolio

Home Depot is the world's largest home-improvement retailer, and it keeps growing. Top-line sales rose 7.2% last year to $108.2 billion and net earnings rose 28.9% to $11.1 billion. 

While most of retail seems like it's clinging to life support, Home Depot has been able to thrive thanks in part to investments it made to maintain an online presence. Online sales grew 24.1% in 2018, and digital sales now make up 7.9% of the total.

Being the biggest gives Home Depot a lot of negotiating leverage with suppliers, which makes it impossible for smaller businesses to compete. Home Depot's size advantage will probably get even stronger over time. Tickets over $1,000 are growing faster than sales from the average customer, and the company has already onboarded 100,000 Pro customers to a new B2B website just for them.  

Home Depot repurchased around 3.8% of its shares last year, which drove earnings up 33.5% to $9.73 per share. With fewer shares to make payments to, the company felt confident enough to raise its dividend payout 32%, and the board of directors authorized a new $15 billion share-repurchase program that will make it more likely that there'll be a rising payout for you to enjoy throughout your retirement years.

The word dividends written on a piece of paper placed on top of a hundred-dollar bill.

Image source: Getty Images.

Moody's: A rating that matters

This is a stock for future retirees who want to rest easy knowing the business in which they own shares can't lose. The world of finance has been using ratings from the same handful of agencies for so long that everyone would rather forget about how badly they messed up 12 years ago than try to change how they do business.

The financial crisis was a temporary hiccup that didn't stop Moody's from raising its dividend payout year after year. That's because there isn't a business, municipality, or a school district in America that can issue debt without a rating from Moody's, or its main rival, S&P Global Intelligence (NYSE:SPGI). These two, along with Fitch, issue around 95% of U.S. ratings, and around 80% of global ratings.

It's been a decade since the company went more than a year without raising its dividend, and the company's raised its payout 400% since 2009. Unfortunately, this safety comes at a price. Moody's has been trading at 22.6 times earnings expectations, and its dividend offers a meager 1.1% yield. 

Image source: YCharts.

The problem with perfect

Stocks perfect for retirement don't always get the most attention, but they tend to draw lots of deep-pocketed investors who don't let go easily. Although these stocks can outperform in a retirement portfolio if purchased at recent prices, patient investors who save for rainy days can usually scoop them up on the cheap during economic downturns.

Investors who bought Moody's 10 years ago, when the market was depressed, have outperformed the S&P 500 by 498% -- and it's been the least successful of these three stocks. Retirees who put $10,000 into UnitedHealth Group a decade ago have watched their investment grow to $135,000 at recent prices.

Past performance doesn't guarantee future returns, but the advantages these three companies have over their competitors will probably help them continue climbing for a long time. Those advantages are the main ingredient in the best recipe for building retirement wealth.