Stocks have had a miserable run so far in 2022. But on June 10, the S&P 500 index hit a major milestone when it tumbled into bear market territory, defined as a 20% drop from recent highs.

The news made big headlines, leaving many investors wondering: Is it safe to invest right now? Here's what you should know about investing in a bear market.

A brown grizzly bear roaring.

Image source: Getty Images.

Is it safe to invest in the S&P 500?

The answer is a resounding "yes." It's safe for long-term investors to invest in the S&P 500, even in a bear market.

When the S&P 500 index hits bear market levels, it makes big news. That's because the index is widely used as a barometer for the health of the U.S. stock market, representing roughly 80% of its total value. But there's nothing magical about that 20% bear market threshold. Cool-headed investors recognize that the distinction is purely symbolic.

Still, investing at a time when stocks are pummeling downward can be unnerving, especially as fears of a recession rise. And there's a real risk that any investment you make in the S&P 500 could be worth less next month, or even next year.

Over long periods of time, however, parking money in the S&P 500 has always been a winning move. In the 94 years between 1926 and 2019, the S&P 500's returns were positive in 73% of all calendar years. Your odds of success grow substantially over longer periods, with the index producing positive returns over a 10-year holding period about 94% of the time. And at no point in history would you have lost money with a 20-year investment in the S&P 500.

Why timing doesn't matter much

As noted above, the S&P 500 index could still drop further for any number of reasons. So you may be wondering if it makes sense to invest now or wait until the stock market finally hits a bottom.

Obviously, we'd all time our investments to get the best bargain if that were possible. The problem, of course, is that even the most seasoned investors have no idea when we've finally hit rock bottom. The good news is that timing doesn't matter a whole lot.

Charles Schwab analyzed several hypothetical investment portfolios to show the impact of market timing. One hypothetical investor, Peter Perfect, invested $2,000 every year for 20 years straight on the stock market's lowest day of the year, meaning he scored the lowest prices. Another investor, Rosie Rotten, had some truly bad luck: She invested her $2,000 at the S&P 500's high point for each of the same 20 consecutive years.

At the end of 20 years, Peter Perfect had $151,391. His returns were superior to Rosie Rotten's, of course. But Rosie's returns were still pretty darn good. She had $121,171 after 20 years. Not too shabby on a $40,000 investment.

What's the best way to invest in the S&P 500?

You can't directly invest in the S&P 500 or any other stock index. Instead, you'd invest in an S&P 500 index fund that tracks the 500 stocks in the index. Some funds have expense ratios as low as 0.03%, which amounts to spending a minuscule $0.30 for fees on a $1,000 investment.

The best way to start investing is by setting a monthly investment budget. Then you can start dollar-cost averaging by investing that amount every month, regardless of stock market news.

Two caveats, though: First, you'll want to pay off high-interest debt, like credit cards, before you get started. Average credit card interest rates are close to 15%, nearly double the post-inflation returns you can expect from stocks in an average year. Second, aim for at least a six-month emergency fund, which will protect you from losing money if you need cash when stocks are down.

So long as you've done those two things, now is as good a time as any to invest, especially considering that you get more bang for your buck by investing when the market is down. Consider putting S&P 500 funds in a Roth IRA, so you can lock in tax-free growth, provided that you follow certain rules.

As long as you're patient, it's an opportune time to invest in the S&P 500. Just keep your cool through the volatility, and remember building wealth is a long-term game.