Investing for the long term, as opposed to day trading, offers many benefits. Holding shares of companies for a while arguably brings more peace of mind, some tax advantages, and the ability for compounding to work its magic. But which corporations are worth investing in for good?

There are about as many candidates as stocks on the market. Most companies will have investors believe they are excellent long-term bets. That's obviously not always the case, but let's consider two solid "forever" investments that'll help you sleep easy at night: UnitedHealth Group (UNH -1.27%) and Berkshire Hathaway (BRK.A -0.18%) (BRK.B -0.38%).

1. UnitedHealth Group

UnitedHealth Group is a leading healthcare company with a wide range of services. Its subsidiary, Optum, offers primary and specialty care solutions to patients, data and analytics services to third-party payers (including government payers), hospital systems, life science companies, and pharmacy care services. UnitedHealth Group is also a leading insurance provider.

It's hard to argue with a business that serves pretty much the full spectrum of stakeholders in the healthcare industry, some of which use the company's products to improve their businesses and deliver better patient outcomes. Though the healthcare sector will certainly change and evolve, it is hard to see all -- or even most -- of the solutions UnitedHealth Group provides become entirely obsolete.

UnitedHealth Group has generally solid financial results. Last year, its revenue increased by 15% year over year to $371.6 billion -- a solid performance. Its adjusted earnings per share of $25.12 grew by about 13% compared to the year-ago period. But why think UnitedHealth Group can continue doing so? Here's one important reason: The company's vertically integrated business and vast network of physicians, patients, and other various institutions that use its services grant it a solid competitive advantage.

Its brand name has come to be associated with excellence in delivering critical healthcare services. That's partly why UnitedHealth Group boasts a 15% share of the U.S. insurance market as of 2023. Its Optum business has been an even bigger growth driver, though. Last year, Optum's top line came in at $226.6 billion, 24% higher than the previous year. Both segments should benefit from an important long-term trend: the world's aging population and a growing need for the kinds of services it provides.

That's why the company hasn't reached a ceiling yet; far from it. Long-term investors will benefit from adding shares of this stock to their portfolios.

2. Berkshire Hathaway

Berkshire Hathaway is arguably the ultimate forever stock for at least two reasons. First, it is a massive, multinational conglomerate comprised of many smaller businesses across various industries. It owns several well-known brands, including insurance giant GEICO, kitchenware product company Pampered Chef, clothing company Fruit of the Loom, and many more.

Berkshire Hathaway is an incredibly diverse play that should continue performing reasonably well regardless of economic conditions. That's a significant competitive advantage.

Second, Berkshire Hathaway is led by one of the greatest investors ever, Warren Buffett himself. The Oracle of Omaha famously has a long-term focus. That's how he built his business to last, and that's why it has been so successful for a long time. Berkshire Hathaway has delivered market-beating returns to its long-term shareholders. Some may point out that Warren Buffett is no spring chicken. The man is well into his 90s.

The recent death of the second in command of the conglomerate -- and Buffett's longtime friend -- Charlie Munger may have brought this issue to the forefront for some investors. However, Buffett and Munger spent a long time creating not just a business but also a culture that should outlive them. The man chosen to replace Buffett at the helm of Berkshire Hathaway is the vice chairman of the company's non-insurance operations, Gregory Abel.

Someone as careful as Buffett wouldn't choose just anyone to replace him as the head of his company, and Abel is inheriting a well-oiled, high-functioning machine. Berkshire Hathaway's future looks excellent. With a market capitalization of $885 billion, it should become a trillion-dollar stock within a year or two. Berkshire Hathaway will continue growing for a long time afterward.