Amazon (AMZN -1.14%) is one of the most well-known e-commerce companies on the planet. Investors watched its market value soar to more than $1.8 trillion during the earlier days of the pandemic. And over time, the company has delivered a lot more than groceries or books to your doorstep. It's delivered top-notch earnings growth and share performance.

This year, though, the stock is heading for a 44% decline. Why? Amazon isn't immune to the pressures hurting the entire retail sector. I'm talking about higher inflation and general economic woes. Now, as we head toward 2023, you may be wondering what to do about this beaten-down stock. Let's check out two reasons to buy Amazon -- and one reason to sell.

1. A steal on a monster margin business

When we think of Amazon, we may focus on e-commerce. But the company's biggest moneymaker actually is its cloud computing business. That's Amazon Web Services, or AWS. Last year, AWS made up more than 70% of Amazon's total operating income. That's huge.

But here's what's even better. AWS' margins are enormous. Operating margin averages about 30% each quarter. How does that compare to Amazon's e-commerce margins? In the earlier days of the pandemic, as revenue surged, Amazon's e-commerce operating margin came in at about 4%.

So, not only is AWS generating revenue in the billions of dollars -- but it's also making a good deal of profit from every dollar sold.

In even more good news, if you buy Amazon shares right now, you'll get all of this growth for a steal. The stock trades at only 1.9 times sales right now. That's its lowest by this measure since 2015.

2. Prime is getting stronger

Amazon's e-commerce business has seen better days. Rising inflation is hurting it in two ways. First, it's pushed Amazon's costs -- fuel to transport goods, for example -- higher. Second, it's weighing on customers' wallets. So, they may spend less on Amazon.

But before we give up on Amazon's e-commerce business, it's key to look at growth of its Prime subscription program. In the most recent quarter, Amazon said Prime Video release The Lord of the Rings: The Rings of Power spurred more new Prime subscriptions than any other Amazon original. And the first broadcast of NFL Thursday Night Football sparked the three-biggest hours of Prime signups ever.

Amazon also said this year that members are spending more -- and relying more on Prime than ever before.

Prime already includes more than 200 million members worldwide. The recent growth, along with longtime members, should translate into more revenue growth in the coming year. And that could lead to positive share performance.

Reason to sell: Amazon isn't out of the woods yet.

Today's economic woes won't disappear overnight. And neither will the impact they've had on Amazon's earnings. Amazon's operating income dropped by almost a half year over year in the third quarter. And free cash flow has shifted to an outflow over the trailing 12-month period. Amazon's return on invested capital also is falling. 

Investors may wait for significant earnings improvement before returning to the Amazon story. And if this happens, the stock may slip further -- or stagnate in the new year. Some investors who already have gained over time on their Amazon position may be tempted to sell -- and invest in a company less sensitive to today's economic environment.

Should you buy or sell?

The reasons to buy Amazon outweigh the reason to sell this great, long-term stock. It's impossible to guarantee Amazon stock will recover next year. But today, valuation looks good considering the long-term picture.

AWS' strength and Prime's growth may give the stock reason to climb -- as soon as next year. And investors who get in on the shares now would benefit.

What if Amazon takes longer to recover? That's OK too. The company's leadership in the growth markets of e-commerce and cloud computing mean Amazon stock is very likely to thrive. And that could equal enormous returns over time.