Billionaire investor Warren Buffett has a track record anyone would love. He's led Berkshire Hathaway to a compounded annual gain of more than 20% over 56 years. That's double the gain of the S&P 500 index over the same period. So it's no surprise investors of all experience levels trust his investment choices.

Now, as we wrap up 2022, you also may be wrapping up your investments for the year. And what better way to end than on a Buffett-inspired note? If you have $1,000 -- or even less -- you can get in on two Buffett stocks that you'll want to hold on to for the long term. One is an e-commerce giant that's ripe for recovery, and the other is a healthcare player that's crushed the market this year. 

1. Amazon

Amazon (AMZN -1.38%) is heading for a 45% decline this year. That's difficult for investors who bought the shares in recent times. But if you're one of them, a look at Amazon's long-term share performance should make you feel better.

Amazon has proved its ability to deliver gains over time. The stock has climbed more than 600% over the past decade. And Amazon has grown earnings too.

So why have the shares dropped this year? Higher inflation has hurt Amazon in two ways. It's increased the e-commerce company's costs. And it weighs on the wallets of Amazon's customers. That means they have less to spend on Amazon. All of this has resulted in quarter after quarter of decreases in operating income and operating cash flow.

But remember, today's economic problems are temporary. And a leader like Amazon has what it takes to weather the storm and thrive afterward. Today, Amazon is making wise moves. It's improving its cost structure and favoring investment in its cloud computing business, Amazon Web Services (AWS). This business is still growing in the double digits.

These decisions today should help Amazon grow once economic pressures lift. And at that point, Amazon may truly benefit from its leadership in e-commerce and cloud computing.

Today, Amazon shares trade for 1.8x sales. That's the stock's lowest by that measure since 2015. Considering the growth of AWS and the e-commerce business since that time, today's price looks like a steal.

2. McKesson

McKesson (MCK -1.06%) has climbed about 50% so far this year -- clearly defying the bear market.

But this healthcare company could gain a lot more over time. That's because it's at a positive turning point, favoring business areas that support earnings growth.

But first, it's important to note that McKesson is among the safest of healthcare stocks. It doesn't face the one big risk in this industry: failure of a product candidate in development. That's because McKesson doesn't develop drugs. Instead, it distributes them. The company also provides services to pharmaceutical companies.

Now, back to the turning point: McKesson is streamlining its business. As part of this, the company is divesting its European operations. So far, it's exited 11 out of 12 markets.

And McKesson is focusing on the high-growth areas of biopharma services and oncology. For example, it joined forces with HCA Healthcare to improve patient and doctor access to oncology clinical trials.

These moves offer the company engines for earnings growth down the road -- and catalysts for share price increases. At the same time, return on invested capital is on the rise again.

MCK Return on Invested Capital Chart

MCK Return on Invested Capital data by YCharts

McKesson generally has increased revenue over the past two decades. It's likely recent efforts to focus on high-growth areas will keep that trend going.

In spite of McKesson's great gains this year and over time, the stock only trades for about 15 times forward earnings estimates. So this Buffett stock still looks like a great deal for long-term investors.