The idea of holding on to investments for decades can be intimidating. Predicting the future is famously difficult work, and it's all but certain that some of your forecasts will be incorrect. On the other hand, having an ultra-long-term approach to some of the stocks in your portfolio will drive you to focus on great businesses that are poised to go the distance. And it's a time-tested fact that buy-to-hold investing tends to yield the best results.

World-beating investor and Berkshire Hathaway CEO Warren Buffett has famously said that his company's preferred holding period is "forever," and his investment firm's incredible track record of success evidences the benefits of finding great businesses at reasonable prices and settling in for the long haul. If you're looking for set-it-and-forget-it stocks that are low in risk and high in quality, these three companies should be part of your portfolio. 

An hourglass next to a pile of coins.

Image source: Getty Images.

1. Waste Management

As the company's name suggests, Waste Management (WM 0.40%) runs a business that revolves around collecting, storing, and recycling trash. That might not be the most glamorous industry, but it's absolutely essential.

Waste Management stock yields roughly 1.9%, and the company has a low-risk business and a path to steady long-term growth that round out the stock and make it an appealing forever investment. It also has an impressive payout growth streak, with the company having increased its dividend annually for 15 consecutive years, highlighted by an average annualized growth rate of roughly 6% in its payout over the last five years.

Waste Management enjoys a regional monopoly in most of the territories that it operates in, and the high starting costs and government regulations that govern the industry mean that its business faces little competition. These dynamics put it on track to continue delivering slow, steady growth over the long term, and acquiring and integrating other companies in its field give the business ways to expand its territory and take advantage of new operating efficiencies. 

An economic downturn can lead to reduced demand for Waste Management's services, but even a temporary recession shouldn't seriously disrupt its business. The long-term trajectory is that there will be greater need for trash collection and storage as the population increases and the economy grows, and that makes Waste Management a great stock to buy and hold.

2. Walmart

Walmart (WMT 0.71%) is a business that can thrive through thick and thin. For proof of that, take a look at the stock's dividend-adjusted total-return performance compared with that of the S&P 500 index in the three-year period starting from the beginning of the Great Recession.

WMT Total Return Price Chart

WMT Total Return Price data by YCharts.

Amid a challenging economic backdrop, Walmart's budget-focused, one-stop-shopping business model allowed it to post substantial sales and earnings growth and dramatically outperform the broader market.

It's worth noting that the retail market has changed a lot over the last decade. E-commerce is claiming a greater share of overall retail spending with each passing year, and this trend has caused some investors to worry that will eventually crush the brick-and-mortar retail giant. That doesn't seem likely. 

Walmart has been making a big online push as well, with its e-commerce sales soaring 41% year over year in the third quarter and management reporting encouraging momentum for its grocery-delivery business. If grocery delivery takes off, Walmart's unparalleled warehouse infrastructure in the category and decades of logistics experience make it one of the most likely winners in the space. Walmart has made smart investments in e-commerce in its core domestic market and abroad -- building its business in Europe and acquiring Flipkart, India's leading e-commerce platform.

The company is also experimenting with in-store health services, offering dental care, vision and hearing tests, and counseling. This could create another growth avenue, one that helps bring shoppers to its stores even as online retail continues to gain ground. 

Walmart stock yields roughly 1.8% and has a 46-year streak of dividend growth at its back. 

3. PepsiCo

PepsiCo (PEP 0.48%) stands as one of the the world's largest food and beverage companies, and its strong brands and powerful advantages in infrastructure and distribution have allowed it to deliver great returns for long-term shareholders. Outside of its namesake cola and other soda products like Mountain Dew, PepsiCo also owns beverage brands including Tropicana, Gatorade, Aquafina, and Lipton, and billion-dollar snack brands including Quaker, Doritos, and Lay's. Even with declines for soda sales in the domestic market, the company remains well positioned to continue posting long-term growth and increasing its dividend. 

The stock yields 2.8%, and the company has a 47-year streak of delivering annual payout growth. That puts it just three years out from the 50-year streak needed to achieve Dividend King status, and investors can feel pretty confident that the company will make it there and continue hiking its dividend for decades to come. 

PepsiCo has been making smart moves to develop snacks and beverages that better cater to shifting consumer preference for healthier options in the domestic market, and the company has also been making some promising acquisitions in categories like sparkling water and protein products. Smart acquisitions should expand the company's top line and pave the way for increased profits as these new businesses benefit from the company's virtually unparalleled global distribution network and great relationship with retailers. 

The company has a strong balance sheet to fund acquisitions and other growth initiatives, while also making generous cash returns to shareholders through dividends and stock buybacks. As the global middle class continues to grow and trends like automation and analytics-driven logistics continue to open up new business efficiencies, PepsiCo looks poised to continue rewarding long-term investors.