When Warren Buffett says the best time to sell a stock is never, you aren't meant to take it literally. Buffett himself sells stocks all the time. The intention is for investors to have a long-term outlook and only buy companies they would be happy to hold onto forever.

Sure, some WallStreetBets traders made a mint piling into GameStop earlier this year to capitalize on the hype with no plan to hold for more than a month or two, but that's not the way to build long-term wealth. You're just as likely to lose your entire investment as double it, let alone turn it into $1 million.

Following are four stocks you could easily add to your portfolio and forget about for the next 20 years.

Mother and son putting coins into piggy bank

Image source: Getty Images.

Amazon.com

Synonymous with e-commerce, Amazon.com (AMZN -1.65%) is also the backbone of much of business and government through its cloud computing Amazon Web Services. Retail is now profitable for Amazon, but it was AWS that carried the company for years as it built out its e-commerce and logistics operations.

AWS accounts for just 12% of Amazon's $386 billion in annual sales, but still provides 59% of total operating income and will shape the direction Amazon takes in the future. And Amazon is now a cash-generating machine with free cash flow in the first quarter jumping to $31 billion over the last 12 months, a 20% increase from the fourth quarter. 

With over $73 billion in cash and equivalents on its balance sheet and growing, Amazon can easily afford a dividend payment, which is what the next candidate did when its own cash hoard approached $100 billion.

Apple

Apple (AAPL 0.52%) has consistently been able to confound analysts who routinely forecast the tech giant's latest innovation won't find favor with consumers, only to see sales far surpass expectations. Technology is always evolving and consumer tastes are forever changing, but Apple has proved adept at keeping its finger on the pulse of where preferences are heading rather than where they are.

While tech forward hardware like the iPhone and iPad will undoubtedly continue being a part of Apple's DNA, look for services to play an increasingly important role over the next 20 years, because they are critical to its success now

Segment revenue surged 26% in the first quarter to a record $16.9 billion, a meaningful acceleration over the 16% gain in the fourth quarter and almost one-fifth of total revenue. As noted, Apple also pays a dividend of $0.88 per share a year that yields a modest 1%, but with that you're getting substantial capital appreciation potential.

Leggett & Platt

You've probably never heard of Leggett & Platt (LEG -1.32%), even though it's given you critical support over the years. It's primarily a manufacturer of innerspring coils for mattresses and sofas, but it's also a supplier to the auto and aerospace industries, furniture manufacturers, and flooring and textile businesses for various mechanical components related to its core operations.

It's the kind of boring business investing legend Peter Lynch would love, and it has a long history of success -- it was founded in 1889 -- and of rewarding shareholders by paying a dividend that yields 2.9% annually. Management has said that maintaining its position on the list of Dividend Aristocrat stocks, or those that have increased their payouts for 25 years or more, is an important strategic consideration.

Because it has actually raised the dividend for 49 straight years, it means it's about to become a Dividend King, or a company that's increased its payout for 50 years or more.

McDonald's

Fast-food giant McDonald's (MCD -0.42%) seems to have finally learned that it does best when sticking to what it knows best: providing good-tasting food at a good price. The growth strategy announced last November commits to focusing on burgers, chicken, and coffee, the three pillars that have driven sales to over $20 billion annually. Last year was obviously an anomaly, but even then it was able to produce some $7.3 billion in operating profits.

McDonald's is also focused on what it calls the "three Ds" of digital, delivery, and drive-through. Allowing customers to remotely order and choose the most convenient option of getting it will be key for all restaurants, but McDonald's is a leader in the space. 

The drive-through window has always been crucial to its success, representing 70% total sales, but so has the morning daypart. Breakfast accounts for 25% of sales and 40% of profits, which is why McDonald's CEO Chris Kempczinski says, "We have to win at breakfast."

Knowing what its customers want and delivering it them, literally and figuratively, will continue driving the Golden Arches for the next 20 years.