Building wealth in the stock market may seem like a daunting task. There are countless stocks and funds to choose from, and investing in the wrong places could be costly.

However, while there will always be some degree of risk when investing in the stock market, some investments are much safer than others. There's one particular index fund that is about as close as you can get to guaranteed positive long-term returns, and it requires next to no effort on your part. Here's what you need to know.

Person sitting at a desk looking at paperwork.

Image source: Getty Images.

A safe yet powerful investment

If you're looking to generate long-term wealth with minimal effort, an S&P 500 index fund could be a fantastic addition to your portfolio. This type of investment tracks the S&P 500 index, which means it includes the same stocks as the index and aims to mirror its performance over time.

The S&P 500 itself includes stocks from 500 of the largest and strongest companies in the U.S., ranging from tech giants like Apple and Amazon to century-old brands such as Coca-Cola and Procter & Gamble. When you invest in just one S&P 500 index fund, you'll instantly own a stake in all 500 of these companies.

Because this type of fund only includes large stocks from solid companies, it's more likely to recover from downturns. In fact, when analysts at Crestmont Research examined the S&P 500's long-term performance, they found that every single 20-year period in the index's history ended in positive total returns.

^SPX Chart

^SPX data by YCharts

In other words, if you'd invested in an S&P 500 index fund at any point in history and simply held it for 20 years, you'd have made money -- no matter how volatile the market was in that time. If you're nervous about market turbulence, an S&P 500 index fund is one of the safest and most reliable funds out there.

Perhaps the biggest advantage of investing in an index fund is that it requires very little effort on your part. All the stocks are chosen for you, and you never need to worry about deciding when to buy or sell. Simply invest whatever you can afford each month, then sit back and wait for your money to grow.

How much can you earn with an S&P 500 index fund?

Index funds are long-term investments, so the more time you give your money to grow, the more you can potentially earn. Even safer funds like the S&P 500 index fund can experience short-term volatility, but over decades, it's incredibly likely that you'll see positive total returns.

Historically, the market itself has earned an average rate of return of around 10% per year -- meaning the annual highs and lows have averaged out to around 10% per year over decades. To play it safe, let's assume your investment earns slightly lower returns of around 8% per year, on average.

If you were to invest, say, $200 per month while earning 8% average annual returns, here's approximately how much you could accumulate over time:

Number of Years Total Portfolio Value
20 $110,000
25 $175,000
30 $272,000
35 $414,000
40 $622,000

Data source: Author's calculations via investor.gov.

Again, the more time you have to invest, the easier it will be to build a robust portfolio worth hundreds of thousands of dollars. Regardless of how much you can afford to invest per month, getting started now can help maximize your long-term earnings.

S&P 500 index funds are a fantastic choice for those looking for a safer, more reliable, and nearly effortless investment. By investing consistently and staying invested for the long haul, you could build a portfolio worth hundreds of thousands of dollars or more.