Since hitting a low in October 2022 while the Federal Reserve was aggressively hiking interest rates, the stock market has come roaring back. The S&P 500 is up 21% in the last 12 months, as investor sentiment is very positive.

On Jan. 29, the broad index of 500 large and profitable businesses closed at a record high of 4,927.93 after its recent gains. This might discourage investors who missed the rally and who have been sitting on the sidelines.

But there's good news: It's still a wonderful time to invest money in the stock market. Here's why.

A rising stock market

In the last 10 years, the S&P 500 has increased at an annualized pace of 12.9%, including dividends. That's a superb return that exceeds the market's historical long-run average of about 10.2% per year. But as we stare at a new peak level, it's understandable that investors might think returns will not be as great from here.

Over any one-year period, there's a 73% chance of a positive return in the market. But this figure increases as we extend our time frame.

Over any 10-year period, you'll make money investing in stocks 94% of the time. If we look out 20 years, there is basically no chance you would lose money. So over many years and many decades, the market usually always goes up.

To take this analysis one step further, let's assume that you were so terribly skilled that you only invested at new all-time highs. Since 1970, in this scenario, the S&P 500 produced an average annualized return of nearly 11% over the following decade. That's not too shabby.

Armed with this uplifting information, it's obvious that it's always a good time to be a buyer of stocks. And not only that, but time in the market is also what matters far more than trying to wait and correctly predict when things will bottom out. The earlier you start investing and the longer your time horizon, the better off you are.

looking at stock chart on smartphone.

Image source: Getty Images.

Some investment options

Buying and holding an S&P 500 index fund or exchange-traded fund (ETF) might be your best bet to put this information to use. You might be wondering where to start, and luckily, there are numerous options.

Investors can buy top index funds like the Fidelity 500 Index Fund, Schwab S&P 500 Index Fund, or Vanguard 500 Index Fund Admiral Shares.

There's also the SPDR S&P 500 ETF Trust, iShares Core S&P 500 ETF, and Vanguard S&P 500 ETF. These ETFs share characteristics with the index funds I just mentioned, primarily that they are low-cost methods to gain S&P 500 exposure. One key difference, though, is that ETFs provide better liquidity, as they trade during typical market hours. It ultimately depends on your preferences.

When it comes to these choices, it's wise to invest at frequent intervals as well. This practice is known as dollar-cost averaging. And it not only results in building up the habit of continuously investing, but it also can seriously boost your returns over time.

Seeing the market continue to hit fresh highs might discourage someone looking to put money to work. But it's always a good idea to remain optimistic. The market rewards those who have a long-term mentality and who invest early and often.