With stock prices falling and inflation continuing to surge, a recession is looking more and more likely. In fact, there's a 50% chance that we'll experience a recession within the next 18 months, according to research from CNN.

To be clear, nobody can predict exactly how the economy or the stock market will perform in the near term. But if a recession is looming, it's wise to start preparing for it now.

While everyone's situation will be different, there are a few steps you can take to keep your finances as safe as possible.

1. Strengthen your savings

One of the most important steps to take when a recession is on the horizon is to strengthen your emergency fund.

Ideally, you should have enough savings to cover at least three to six months' worth of general living expenses. Stock prices tend to sink during recessions, making it a particularly bad time to tap your investments. If you lose your job or face an unexpected expense, a healthy emergency fund will be a lifesaver.

If you don't have an emergency fund, saving should be your top priority right now. Also, if you have reason to believe your job could potentially be at risk, it's especially important to focus on building a solid safety net.

2. Continue investing normally

If your finances are in good shape and you could easily cover six months' worth of expenses, you may choose to invest any extra cash.

While it's not always easy to invest during a recession, it can pay off down the road. When stock prices are lower, you have a fantastic opportunity to buy high-quality stocks at a discount. When the market inevitably recovers, you could see substantial gains.

3. Focus on the long term

Nobody knows for certain what will happen with the stock market or the economy over the next few months. If we do experience a recession, there's a chance stock prices will fall even further, and things could get worse before they get better.

It's critical, then, to keep a long-term outlook. If you invest now, your portfolio could immediately lose value if stock prices dip. That's normal. Try your best to avoid getting caught up in the market's day-to-day fluctuations, and focus instead on the future.

Chart showing overall upward trend in the S&P 500 since 2000, with recent decline.

^SPX data by YCharts

Over the long run, the economy has recovered from every single recession, and the stock market has rebounded from every single downturn. By staying invested and not pulling your money out of the market in panic, you can simply ride out the storm until things improve.

Keeping your money safe

It's unclear whether we'll experience a recession or not, but it's becoming more likely. Now is the time to double-check that your savings are strong enough to handle any unexpected expenses, and if so, think about your investing strategy.

If you can afford to invest right now, it's a fantastic opportunity to generate long-term wealth. But regardless of what you choose to do, stay focused on the long term. Recessions aren't easy, but they are temporary. With the right strategy, you can keep your money safe regardless of what happens.