New economic data shows that GDP has declined for two straight quarters, meaning the U.S. economy has contracted during the first half of 2022.

This is commonly referred to as a technical recession, though we're not officially in a recession right now. The National Bureau of Economic Research, which includes the economists in charge of declaring whether the country is in a recession, has not made the official call yet -- though it could be coming.

All of this uncertainty can be alarming for investors, and it can be difficult to decide what to do with your money. Is it really safe to invest right now? Or should you hold off? There are a few things to consider.

Two people with serious expressions looking at documents.

Image source: Getty Images.

When you should wait

It can be tough to invest during a downturn, especially if you're struggling financially. If you don't have any emergency savings, it might be wise to focus on that goal before you invest in the stock market.

Economic downturns are among the worst times to sell your investments. If you buy now and the market plummets, your portfolio will drop in value. Then if you face an unexpected expense or lose your job and realize you need that money, you might be forced to sell your investments at a discount -- and lock in your losses.

Before you invest, be sure you have at least a few months' worth of savings stashed in an emergency fund. That way, it will be much easier to leave your investments alone and avoid withdrawing your money at the worst possible time.

Also, if you're investing for a short-term goal, it might be best to hold off for now. For instance, if you're investing money that you expect to use for a down payment on a house in the next few months, that could be risky. If the market falls before then, you'll need to either postpone your goal or sell your investments at a discount.

Why it pays to keep investing

It can seem counterintuitive to continue investing when the stock market is down and the economy is inching closer to a recession. After all, if a steeper decline is coming, investing now could feel like a risky move.

However, downturns are actually among the best times to invest because stock prices are significantly lower. By continuing to invest, you can snag quality stocks at a fraction of the price. Right now, some stocks have seen their prices fall by 20%, 30%, 40%, or more -- giving you the chance to buy at a hefty discount.

The caveat, though, is that it could take time for your investments to rebound. Nobody knows how long this economic downturn will last, so if you choose to buy, be sure you're willing to hold your investments for at least a few years.

While that's a long time to wait, the payoff could be enormous. By investing when prices are at their lowest, you can see substantial returns when the market inevitably rebounds.

Recessions can be daunting, but they are normal. When you put a strategy in place, you can ensure you're as prepared as possible regardless of what happens with the economy.