The S&P 500 officially entered bear market territory again, falling more than 20% from its peak in early January.

When the stock market is volatile, it's not always easy to keep investing. Many investors have watched their portfolios plummet in value over the last several months, and that can be tough to stomach.

Nobody knows for certain where the market is headed or whether stock prices will continue to drop. But is right now really a good time to invest? Here's what you need to know.

The advantages of investing during a downturn

It's tough to invest when the market is in a slump. But right now is also one of the best opportunities to generate life-changing wealth. By reframing your mindset about downturns, you could potentially make a lot of money over time.

Rather than thinking of this bear market as a stumbling block, think of it as an opportunity to buy your favorite stocks while they're on sale. Stocks that were incredibly expensive a few months ago are now more affordable, and if you've been waiting for a chance to load up on quality investments at a discount, now is the time.

Investing now could also set you up for significant gains down the road. When the market eventually rebounds (because it will recover at some point), stock prices will increase once again. When that happens, you could see substantial returns.

Keeping a positive long-term outlook

Even if it makes sense to invest right now, that doesn't necessarily make it easy. Stock market downturns are intimidating, even to the most experienced investors. So if you're nervous about investing right now, that's normal, and you're not alone.

One of the best ways to calm those nerves is to stay focused on the long term and try to avoid getting caught up in the market's day-to-day fluctuations.

The market has faced dozens of corrections and crashes in the past, and it's recovered from every single one of them. In fact, since 1928, the S&P 500 has fallen by at least 20% on 21 separate occasions -- not including this current downturn. On average, that's a significant downturn approximately every 4.5 years.

^SPX Chart

^SPX data by YCharts

Over time, though, the market has always rebounded from even the worst crashes. If history shows us anything, it's that it's extremely likely the market will recover from this downturn, too.

How to keep your money as safe as possible

With the right strategy, there's a good chance that your investments will not only survive a downturn, but thrive in the long term.

First, make sure you're only investing money you won't need for the foreseeable future. The longer you leave your money in the market, the easier it will be for it to grow. If you don't have any savings set aside in an emergency fund, it may be best to focus on that goal before you invest.

If you can afford to invest right now, make sure you're choosing the right stocks. Long-term investments are the most likely to bounce back after periods of volatility, and the strongest companies make for the safest stocks. Blue chip stocks are generally a safe bet, but any business with solid underlying fundamentals has a better chance of surviving a downturn.

Stock market downturns are not always easy to stomach, but investing when prices are down can supercharge your savings over time. By choosing the right stocks and staying invested for the long haul, you can earn more than you might think.