Following the unbelievable amounts of monetary and fiscal stimulus to jump-start the economy during the COVID-19 pandemic, inflation started to surge. To combat these rising prices that proved to be anything but transitory, the Federal Reserve raised interest rates at the fastest pace in history starting in March of 2022.

Investors expected the economy to tip into a recession, sending stock prices sharply lower in 2022. However, both the S&P 500 and the Nasdaq Composite Index have been on an impressive run since the start of last year, resulting in the popular belief that the U.S. economy is on solid footing right now.

However, there are still reasons to be cautious right now. If you're one of the skeptics who is worried about a looming recession, history says you should do this one thing as it pertains to your investments.

Keep on keeping on

People should keep investing their hard-earned savings in the stock market, no matter what has happened in the recent past and no matter what might happen in the near future. This means adopting a dollar-cost average strategy if you don't already. Putting small amounts of cash to work in the market on a regular basis, regardless of what happens with asset prices or the economy, will set you up on a path toward long-term financial success.

Investors should consider buying low-cost index funds or exchange-traded funds that track the broader S&P 500. Over the past 30 years, had you invested $1,000 up front, plus an additional $50 a month thereafter, your portfolio balance would be an astonishing $149,000 today.

I apologize if you were looking for some sage advice on what specific stocks to buy or whether you should completely dump all your holdings. The boring and simple course of action is usually the best.

It certainly might be tempting to try and time the market. If you expect difficult times ahead, it makes sense to wait until stock prices fall before buying again. This is the rational way to think when the goal is to avoid investment losses.

However, trying to time the market is almost sure to lead to more pain than gain. It's almost impossible to hop in and out of the market to miss the worst days and take advantage of the best days.

It's smart to maintain a long-term mindset. And understand that the economic cycle is normal.

newspaper that says recession fears.

Image source: Getty Images.

Cautiously optimistic

If you've been paying attention to the financial news, it seems like we've been in a so-called "uncertain economic environment" for quite some time. But the reality is that the times are always uncertain. No one ever knows what's going to happen next.

Even the Federal Reserve, a group of the most accomplished economists on Earth, have no clue. They missed the mark when they thought inflation was first transitory in late 2021. They originally predicted numerous rate cuts for this year. But inflation is proving to be sticky.

So, what if central bankers have to keep rates higher for longer? This might result in a recession. Or it might not. Again, nobody knows what the future will hold, no matter how smart their forecasts might sound.

For what it's worth, I believe investors should always be optimistic. The U.S. economy has expanded steadily over time, thanks to a focus on innovation and technological advancements that move the needle. Betting on this trend has historically worked out well.

You can spend your days paying attention to interest rates, GDP growth, oil prices, unemployment rates, or the unlimited number of other data points out there. Or you can continuously invest savings in the market. The latter choice seems like the best option.