It can be hard to hold onto a stock for many years, through thick and thin. The temptation to sell is strong, and even the most disciplined investors succumb to that urge. But buying and holding shares of high-quality companies for many years is the best way to build wealth. Every temporary sell-off is an opportunity to add to your stake at a lower price, not a reason for panic.

What kind of stocks are good enough to hold for decades? Three of our Foolish investors think Walt Disney (DIS -0.43%), International Business Machines (IBM 0.46%), and Waste Management (WM 0.55%) fit the bill.

A statue of Walt Disney and Mickey Mouse at Disney World

Image source: Disney.

The bedrock to build a nest egg upon

Rich Duprey (Walt Disney): Being able to successfully adapt to changing market conditions makes for an enduring investment, but using those adaptations while simultaneously relying upon that which made you a success is a rare combination to find in a company. Disney is one such stock that not only invents new ways to grow its business, but uses its core identity to underpin the whole.

Of course, animated feature films remain the raison d'etre for Disney's success over the decades. From the earliest titles to the latest movies, animation is the bedrock upon which the entertainment giant was built. But if Disney had stayed just a movie studio, it's likely it wouldn't be where it is today. Instead, it used those movies to build a theme park empire and from there stretched out into live-action movies, toys, broadcast television, and more.

The potential deal with Twenty-First Century Fox would add a massive portfolio of assets to its already burgeoning warehouse of brands, including cable stations such as FX and National Geographic, Fox's stake in streaming service Hulu, a 39% stake of European satellite provider Sky, Star in India, and the rights to properties including Avatar, X-Men, Fantastic Four, and Deadpool.

That Disney can then turn around and use all of these weapons in its arsenal to launch its own streaming service to take on Netflix ensures the House of Mouse will be around for decades to come.

Disney represents one of those rare investments that you can truly buy and hold without worrying about whether it will be there in the future.

A century-old tech giant

Tim Green (International Business Machines): IBM has been around for over a century. Its mainframe computers have been powering industry for the past fifty years. Despite its messy and painstakingly slow transformation over the past five years or so, Big Blue isn't going anywhere.

If you want to invest in a company at the center of many of the major megatrends in technology, IBM is it. The company's cloud computing business generated $17 billion in revenue last year, up 24%. Its Watson artificial intelligence platform is being used in a wide variety of industries, from healthcare to financial services. And its blockchain efforts are starting to yield tangible results, most notably a joint venture with shipping giant Maersk aimed at bringing efficiency and lower costs to the shipping industry.

You get IBM's growth prospects for next to nothing, because the stock trades at such a beaten-down valuation. Based on the company's adjusted earnings guidance, shares of IBM go for just over 11 times earnings. You also get a dividend yielding 3.9%, more than double that of the S&P 500.

IBM has only just returned to revenue growth, and its growth in the coming years will likely be slow as legacy businesses drag down the more dynamic parts of the company. But betting against IBM would be a mistake.

There's treasure in trash

Tyler Crowe (Waste Management): Investing over multidecade periods typically means finding companies that are going to be nearly impossible to disrupt over time. In that vein, an industry that doesn't look like it is going away anytime soon is waste disposal. No matter how consumption conscious we may be, we all generate some trash that needs to be properly disposed of. That is where Waste Management shines, because so few people want to do it or have the capital available to build out the scale necessary to compete in this business.

From the exhaustive permitting to the challenges of handling the byproducts of waste storage to having an adequate fleet of collection vehicles, it takes a deft operator and capital allocator to make this a lucrative venture. Fortunately, for those that can do it, it is a business that can throw of gobs of free cash flow. Since this is a rather low-growth space, Waste Management's management has been able to return lots of cash to its shareholders in the form of a steadily growing dividend and share repurchases. Combined, these have translated into fantastic returns for investors willing to hold onto shares over the long term.

WM Average Diluted Shares Outstanding (Quarterly) Chart

WM Average Diluted Shares Outstanding (Quarterly) data by YCharts.

Perhaps down the road, we will change the way in which we handle our trash in some innovative way. That seems to be a long way off, though, and chances are Waste Management will be one of the companies that drives that change when it comes. Shares of Waste Management aren't cheap by any means -- the recent changes to the U.S. corporate tax rate make its price-to-earnings ratio deceivingly low -- but if you are looking to hold onto this stock for decades, the price you pay today might not be quite as important.