If you're just getting started investing, give yourself a pat on the back. Investing in the stock market is one of the smartest financial decisions you can make, and you're already on your way to generating long-term wealth.

Choosing the right investments is one of the main roadblocks new investors face. It can be overwhelming to decide which stocks to buy, especially when you have seemingly endless options.

The S&P 500 is a stock market index that's considered one of the primary benchmarks of the overall market's performance, and Amazon (AMZN -2.99%) is one of the largest and most successful companies in the world. If you're buying your first investment, which one is a better choice? Here's what you need to know.

Two people standing in a kitchen looking at a laptop.

Image source: Getty Images.

The case for Amazon

Amazon, of course, is an incredibly successful company that has seen phenomenal growth over the last couple of decades. Over the past 10 years, its stock price has increased by a whopping 1,380%, where it currently sits at just over $3,300 per share.

While Amazon is an expensive stock, you can pay less than its full share price by investing in fractional shares. With this strategy, you can buy a small slice of a company's stock for $100, $10, $1, or however much you can afford to spend. So if Amazon's hefty price tag is giving you pause, keep in mind that you don't have to spend thousands of dollars to buy the stock.

Amazon also has plenty of room for growth, which has investors optimistic for its future. Earlier this year, for example, it rolled out its virtual healthcare program, Amazon Care. The company is also planning to roll out brick-and-mortar stores to compete with retail giants like Walmart. There's a reason Amazon has remained a Wall Street favorite for so long, and the company doesn't seem to be slowing down anytime soon.

While Amazon may be a worthwhile addition to your portfolio, keep in mind that you'll need more than just one stock to get started investing. Most experts recommend investing in at least 25 stocks to build a well-diversified portfolio, and this is where the S&P 500 shines.

The case for the S&P 500

First, it's important to note that you can't invest in the S&P 500 itself. Rather, you can invest in an index fund or exchange-traded fund that mirrors the S&P 500 and includes all the same stocks as the index.

Investing in an S&P 500 index fund is one of the easiest ways to get started in the stock market. This index includes just over 500 stocks of the largest companies in the U.S. -- including Amazon. By investing in just one fund, you can create an instantly diversified portfolio without having to choose individual stocks.

S&P 500 index funds are also more protected against market volatility. While this investment is still subject to downturns, the S&P 500 itself has a long track record of surviving market turbulence. As long as you're patient and hold your investments through good times and bad, it's very likely your S&P 500 index funds will recover from market crashes as well.

Which is the better buy?

Whether you decide to invest in Amazon or the entire S&P 500 will depend largely on your investing style.

If you do buy Amazon, you'll also need to invest in a couple dozen other stocks to create a well-rounded portfolio. This isn't necessarily a bad thing, especially if you enjoy researching stocks and want to make your portfolio as personalized as possible. By choosing individual stocks, you also have a better chance of beating the market -- something that's not possible with S&P 500 index funds.

On the other hand, if you're looking for a low-maintenance investment that does most of the work for you, you can't go wrong with the S&P 500. You'll still own Amazon stock when you invest in an S&P 500 index fund, plus you'll gain exposure to hundreds of other strong and stable companies at the same time.

Amazon and the S&P 500 are both strong investments, and your decision will come down to whether you'd rather buy individual stocks or an index fund. There's no wrong answer, and by understanding your own personal preferences, you can make the decision that's best for you.