Rising inflation and economic woes hurt Amazon (AMZN 1.62%) last year -- and even resulted in the first annual loss in nearly a decade. But the e-commerce giant has been working hard to turn things around. Amazon has been cutting costs, investing in promising areas, and preparing for better times. And these efforts helped the company beat analysts' estimates during the first quarter of this year.

That sounds like great news, right? And it is. But, at the same time, chief executive officer Andy Jassy pronounced 12 words that dampened investors' excitement. The comment had to do with the company's big moneymaker, Amazon Web Services (AWS). Should you be worried? Let's find out.

Higher costs and excess capacity

First, though, a quick summary of Amazon's difficulties -- and what it's done to improve the situation. Rising inflation resulted in higher costs for the e-commerce company. At the same time, it weighed on shoppers' buying power. So, it hurt Amazon in two ways. Amazon also struggled with excess fulfillment capacity after doubling its network in a short period of time. As a result, free cash flow turned to an outflow -- and the company reported a $2.7 billion net loss last year.

To spur a recovery, Amazon reduced costs -- and that involved announcing the elimination of 27,000 jobs -- and worked on efficiency across its fulfillment network. The company also increased investments in high-growth areas to secure leadership down the road. For example, it increased last year's spending in technology infrastructure by $10 billion. That's meant to support growth in AWS. Historically, AWS has driven profit at Amazon.

Now, speaking of AWS, let's move on to the words Jassy said during the first-quarter earnings call.

Regarding AWS, "what we're seeing is enterprises continuing to be cautious in their spending," the CEO said.

In the first quarter, AWS posted a 16% increase in net sales but a 21% decline in operating income. The company also reported that April AWS revenue growth rates have declined about 500 basis points from the first-quarter level.

All of this means growth is continuing to slow at AWS. The business managed to deliver double-digit gains in revenue and operating income last year -- but that trend clearly is over.

Helping clients spend less

In response, Amazon isn't trying to force clients to spend more. In fact, it's helping them to spend less. AWS offers lower-priced data storage solutions and is encouraging clients to go for these options today. For example, it offers them Graviton processors, a budget option for cloud workloads.

So, what we have here is a slowdown in Amazon's highest-profit business. And Amazon is going with the flow.

Should we be worried? No. Instead, we should see this as good news. AWS can't change the fact that its clients are struggling with higher costs these days. And it can't change the fact that they don't have a lot to spend on data storage. What the company can do is keep them coming back even during difficult times -- and ensure they'll be around over time to increase their spending on AWS cloud solutions.

"Customers want help finding ways to spend less during this challenging time, and given that it's best for customers long term, we've been actively helping customers make these adjustments," Jassy said during the earnings call.

All of this is positive because AWS is keeping customers loyal during a difficult time -- and the company is likely to benefit from their increased spending once the economic situation improves.

What does this mean for investors?

This means, like Amazon, we should be patient and remain calm through the AWS slowdown. This is a temporary situation. And Amazon's actions now should lead to more gains from AWS down the road.

AMZN PS Ratio Chart

AMZN PS Ratio data by YCharts

If you haven't yet bought shares of Amazon, this also makes a great time to invest. The stock is trading around its lowest in relation to sales since 2016. But Amazon's long-term outlook remains promising. And the company's latest news shows us its recovery efforts are working.

So you shouldn't worry about AWS -- and instead you should be excited about the potential of Amazon shares over the long term.