Amazon (AMZN -1.38%) is heading for an important moment this month. The retail giant's shareholders recently approved a 20-for-1 stock split. And the operation is about to happen. The shares will start trading on a split-adjusted basis on June 6.

Meanwhile, Amazon's stock performance hasn't been too bright. The shares have lost 37% since their high last July. And they've declined 30% so far this year. So, we can't exactly say Amazon has momentum right now. Does this mean we should avoid the shares? Or is the decline a great opportunity to get in on a long-term success story? Let's find out.

Three investors in an office setting smile while looking at something on a computer.

Image source: Getty Images.

A share price of more than $3,700

There are a few reasons behind Amazon's share performance. When the shares peaked last year, one concern was the price. The stock had reached more than $3,700. Amazon saw tremendous growth in revenue and profit during the earlier stages of the pandemic. But that pace was beginning to slow. Considering that, investors worried there wasn't much room left for share price gains.

Fast forward to early this year. Amazon's earnings troubles deepened. The company reported declines in operating cash flow and operating income in the first quarter. And free cash flow shifted to an outflow of $18.6 billion over the trailing 12-months.

Amazon is suffering from the same problems as other retailers: higher inflation and supply chain problems. The company also is facing another big cost pressure. Amazon nearly doubled its fulfillment network since the start of the pandemic. But in recent times, demand has fallen short of that level of capacity.

So, first, should we worry about Amazon's growth prospects? I wouldn't expect an overnight turnaround. Amazon even said in its most recent earnings call that it expects higher costs due to rising inflation to "be around for some time." But the good news is elements such as rising inflation and supply chain problems are temporary -- and they aren't linked to a particular issue within the company.

More good news

And here's some more good news: Amazon has control over about two-thirds of its incremental costs. Among other efforts, the company plans on improving productivity and reducing new building projects. This means Amazon should be able to bring down costs driven by internal factors such as staffing or the size of its fulfillment network.

As a result, I'm not worried about Amazon's growth over the long term. The path this year probably will be bumpy. It's too early to say whether the difficulties will extend into next year. But over a period of a few years, I expect Amazon's earnings to recover and grow. The company is a leader in two major markets: e-commerce and cloud computing. In fact, Amazon's cloud computing business -- Amazon Web Services (AWS) -- continues to grow sales and operating income in the double digits. AWS doesn't face the same pressures as retail. This makes it a valuable part of Amazon's business -- especially in times of economic troubles.

Now, let's get back to our original question: Is Amazon a buy? If you're looking for a quick, short-term gain, the answer is "no." But I prefer investing over the long term. And from that view, the answer is a definite "yes." Amazon has what it takes to deliver earnings growth over time. And that should translate into more gains for this e-commerce giant.