After declining by over 18% in 2022, the S&P 500 has been on a roll for the past two years. In 2023, the U.S. stock market's most important index gained over 24%, and so far in 2024 it has gained over 26%.

With this 2024 run, the S&P 500 has hit a new high, reaching over 6,090. On one hand, anytime the S&P 500 hits a new high, it's a cause of celebration for the millions of people invested in the index. On the other hand, hearing "all-time high" can cause some to be hesitant about investing at that moment.

If you have hesitations about investing in the S&P 500 with it flirting near all-time highs, here's why you shouldn't.

You don't want to get in the habit of trying to time the market

Whenever a question of whether you should wait to invest because of an index or stock reaching a new high, it generally comes down to assumptions and trying to time the market. Both of these are things you should ideally avoid as an investor.

Many people who ask this assume that a record high means the index or stock is more likely to decline, and they'd rather wait until it does, so they're not investing before a price drop. That's trying to time the market.

In theory, waiting for lower prices to invest makes sense. However, no one can predict how the stock market will perform, especially in the near term. That includes me, you, billion-dollar Wall Street firms, and even the most seasoned and successful investors.

For perspective, the S&P 500 has hit over 50 record highs in 2024, with the first occurring on Jan. 19. Had you held off on investing at any of those marks (minus the last one), you'd be worse off now than you had invested at the high.

^SPX Chart

^SPX data by YCharts

Consistency is the name of the game

Instead of trying to guess how the S&P 500 will perform and timing your investments, a better approach is to use dollar-cost averaging. When you dollar-cost average, you decide on a set amount you can invest and an investing schedule that works for you and then proceed to stick to that schedule regardless of where stock prices are at the time.

For example, imagine someone has $400 they can commit to investing in the S&P 500 each month. Using dollar-cost averaging, they could decide to invest $100 every Monday, $200 every other Friday, or $400 at the beginning of each month.

The frequency you choose isn't too important; it's about what makes sense for your financial situation. What is important, however, is making sure you stick to your investing schedule no matter what. The S&P 500 is at an all-time high? Invest. The S&P 500 hit a slump and is in correction? Invest. The S&P 500 is stagnant? Invest.

By using dollar-cost averaging, you offset the effects of volatility. Sometimes, you'll invest when prices are overvalued; sometimes, you'll invest when they're undervalued. The idea is to trust that it'll even out over time and be much less stressful along the way because you're not trying to time the market and risking being on the wrong side of the guess.

When in doubt, remember this quote: "Time in the market beats timing the market."

My go-to way to invest in the S&P 500

There are several ways to invest in the S&P 500, but my go-to is the Vanguard S&P 500 ETF (VOO -1.04%).

VOO Chart

VOO data by YCharts

S&P 500 exchange-traded funds (ETFs) mirror the same index, so there isn't much of a noticeable difference between them besides cost. I like the Vanguard ETF because its expense ratio is only 0.03%. That's more than 3 times cheaper than the more popular SPDR S&P 500 Trust ETF, with a 0.0945% expense ratio.

The Vanguard S&P 500 ETF is a low-cost option with lots of liquidity, ensuring you can easily buy and sell shares without significant price fluctuations. You can't ask for much more from an ETF.