This year has been rough for nearly everyone, with inflation soaring, the crypto market crumbling, and the entire stock market on a downhill slide. On the surface, then, right now may not seem like the best time to invest.

However, there's one great reason to consider buying now, and it could save you a lot of money over time and supercharge your total earnings: dollar-cost averaging.

What is dollar-cost averaging?

Dollar-cost averaging is a strategy that involves investing a set amount of money at regular intervals throughout the year. For example, rather than investing $5,000 once a year, you would invest $1,250 per quarter, or roughly $400 per month.

When you invest consistently throughout the year, you'll buy at both the market's high points and low points -- sometimes spending more for stocks and other times buying at a discount. Over time, those highs and lows should average out.

That, in turn, can save you money. If you only invested when the market was thriving, you'd end up paying a premium for your stocks and spending more over the long run. 

Also, when you invest during market slumps, you can set yourself up for substantial gains once prices recover. The market has a long history of rebounding from downturns, and by investing now, you'll be able to take advantage of the inevitable upswing.

Dollar-cost averaging in action

To see just how powerful dollar-cost averaging can be, let's look at Amazon (AMZN -0.01%). The company's performance has been up and down over the past five years. At its highest point in July 2021, it reached a price of roughly $186 per share (accounting for its subsequent stock split). At its lowest point in the last five years, it cost around $57 per share.

If you had only invested during the high points of this roller coaster, you would have missed the opportunity to buy at bargain prices. On the other hand, if you had pressed pause on investing between 2020 and 2022 when the stock was surging, you would have avoided paying higher prices, but you also would have missed out on that time to grow your position in the stock.

By investing consistently throughout the highs and lows, however, you can get the best of both worlds. You also don't need to worry about timing the market or deciding when, exactly, to invest. All you have to do is invest at regular intervals and hold your stocks for the long term.

The key to successful long-term investing

When the market is volatile, it can be daunting to invest. But now is the time to take advantage of those lower prices. The key to ensuring your investments survive is to double-check that you're buying the right stocks.

Not all stocks will be able to survive market downturns. But companies with solid underlying business fundamentals have the best chance of pulling through periods of volatility and seeing long-term growth. These are the stocks to look for.

The more of these stocks you have in your portfolio, the more likely it is that your investments will rebound. By investing consistently and keeping your money invested for the long haul, you'll be on your way to generating long-term wealth -- regardless of what the future holds for the market.