Investing in the stock market is one of the most effective ways to generate wealth, but the investments you choose can make or break your portfolio.

For many investors, exchange-traded funds (ETFs) can be a smart option. ETFs are baskets of securities bundled together into a single investment, and they can be a simpler and more straightforward way to invest compared to buying individual stocks.

There are countless ETFs to choose from, all with unique advantages and disadvantages. But there's one ETF, in particular, owned and highly recommended by legendary investor Warren Buffett -- and it could be a fantastic buy heading into 2024.

A powerhouse ETF to keep your money safer

For the most part, Warren Buffett's portfolio consists of individual stocks. However, he does own one type of ETF -- the S&P 500 ETF. Through his holding company Berkshire Hathaway, Buffett owns both the Vanguard S&P 500 ETF (VOO 1.00%) and the SPRD S&P 500 ETF Trust (SPY 0.95%).

S&P 500 ETFs are a fantastic option for those looking to make a lot of money over time with much less risk and effort than individual stocks. This type of investment tracks the S&P 500 index itself, and each fund includes stocks from 500 of the largest and strongest companies in the U.S.

The companies in the S&P 500 are among the best of the best, ranging from tech giants like Apple and Amazon to household names like Coca-Cola and Procter & Gamble. With so many powerhouse stocks, this type of ETF is far more likely to recover from downturns and see long-term growth.

In fact, research shows that it's actually harder to lose money with an S&P 500 ETF than to make money. Analysts at Crestmont Research examined the S&P 500's 20-year total returns to determine how often the index saw positive gains.

They found that in every single 20-year period, the S&P 500 earned positive total returns. In other words, if you had invested in an S&P 500 ETF at any point in history and held it for 20 years, you'd have made money -- regardless of how volatile the market was during that time.

Not only is it lower risk, but the S&P 500 is also incredibly low maintenance because all the stocks are already chosen for you. By investing in just one fund, you'll instantly have a well-diversified portfolio full of strong stocks. All you have to do is hold on to it for as long as possible.

Building long-term wealth in the stock market

S&P 500 ETFs are long-term investments, and given enough time, it's possible to earn hundreds of thousands of dollars or more with little effort on your part.

Nobody knows how stocks will perform over time, but historically, the market itself has earned an average annual return of around 10% per year. While you likely won't earn 10% returns each and every year, the highs and lows should average out to roughly 10% annually over decades.

If you were to invest, say, $200 per month in an S&P 500 ETF while earning 10% average annual returns, here's approximately how much you could accumulate over time:

Number of Years Total Portfolio Value
20 $137,000
25 $236,000
30 $395,000
35 $650,000
40 $1,062,000

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

The sooner you can get started investing, the easier it will be to accumulate hundreds of thousands of dollars or more. Even if you can't afford to invest much right now, time is your most valuable asset. By contributing even a few dollars per week, you could earn more than you might think over time.

One downside to consider, however, is the fact that this investment can only earn average returns. It's impossible for an S&P 500 ETF to beat the market, as it's designed to simply follow the market. If you're looking to maximize your earnings, investing in individual stocks may be a better strategy.

Warren Buffett has long recommended the S&P 500 ETF to other investors, and he even owns two of these funds himself. If you're looking for a safer investment that requires very little effort on your part, an S&P 500 ETF could be a fantastic buy in 2024 and beyond.