When the legendary chairman and CEO of Berkshire Hathaway, Warren Buffett, writes his letter to shareholders each year, the investment world often stops to glean a few lessons from the Oracle of Omaha. Considering Buffett's track record of success, I can't fault investors for poring over his words.

One of the most memorable messages came in his 1996 Chairman's Letter, in which Buffett advised, "If you aren't willing to own a stock for ten years, don't even think about owning it for ten minutes." The advice is 25 years old but timeless. And everyone can benefit from the reminder to focus on buying stocks for the long term to ensure that they select only the highest-quality stocks.

Two healthcare stocks that investors can confidently buy for the long haul are Stryker (SYK 0.09%) and CVS Health (CVS -0.65%). Let's see why.

A surgical team performs surgery on a patient.

Image source: Getty Images.

Stryker

Based in Michigan, Stryker is one of the world's leading medical technology companies with a market capitalization of $100 billion -- and its products are sold in over 75 countries.   

The company divides itself into three segments: orthopaedics, medical and surgical equipment, and neurotechnology. Orthopaedics consists mostly of implants used in joint replacement procedures (i.e., hips, knees, and shoulders); medical and surgical includes everything from bedframes to personal protection gear; and neurotechnology entails spinal implant devices and products used in brain surgery procedures.

The pandemic has been a challenging time for this business. Adjusted earnings per share (EPS) declined 10% year over year to $7.43 in 2020, but this was because millions of elective procedures were delayed last year due to COVID-19. This also led to a 3.6% year-over-year drop in net sales to $14.4 billion last year.

But with the backlog of coronavirus-delayed elective procedures now being performed this year on top of newly scheduled procedures, Stryker should now start to return to its pre-pandemic level of business. Analysts forecast revenue this year will grow more than 20% to $17.3 billion while adjusted EPS is expected to soar 25.4% to $9.32 this year.

The key factor that makes Stryker a great long-term pick is a growing elderly population worldwide. The United Nations anticipates the number of people aged 65 and up will more than double from 703 million in 2019 to 1.5 billion by 2050. Since elderly patients typically require surgical procedures more often, this should be a major catalyst for the company's product demand in the years ahead. It's why analysts expect that Stryker's adjusted EPS will grow more than 13% annually over the next five years.

At its current price of $258 a share, the company is trading at 28 times this year's earnings.  For the amount of growth that Stryker offers investors, this is a reasonable price to pay. And as an added bonus, the company offers a 1% dividend yield that should grow at least in the high single digits annually for the foreseeable future.

A pharmacist speaking with a customer.

Image source: Getty Images.

CVS Health

Mega-pharmacy chain and health insurer CVS Health is also poised to benefit from a growing and aging population. The company makes money in three different ways: retail, pharmacy services, and healthcare benefits.

Retail revenue comes from the various health and wellness products and general merchandise sold in its CVS stores; healthcare benefits revenue is from customer premiums received for its Aetna health insurance plans; and pharmacy services brings in revenue by managing a customer's pharmacy benefits and filling prescriptions. CVS Health accounted for 27.1% of all U.S. retail prescription volumes last year. 

And as the U.S. population ages, it's likely that prescription volumes will continue to increase and result in higher pharmacy services revenue as well as steady foot traffic into its stores. This is why analysts expect CVS Health will deliver 6% annual earnings growth over the next five years.

That's quite attractive for a stock trading at a P/E of 15.4 based on trailing 12 months' earnings -- which is lower than its 10-year median P/E ratio of 16.5. It suggests that CVS is trading at a discount to fair value.

And after five years of frozen dividends to pay for the acquisition of health insurer Aetna, CVS Health CFO Shawn Guertin hinted in the company's latest earnings call at the possibility of a dividend increase next year. Thus, CVS Health could soon see a resumption of robust dividend growth in the coming years.

Even now, the dividend offers a market-beating 2.4% yield. That, along with a solid earnings growth outlook and below-average valuation, makes CVS a strong healthcare stock for the long haul.