The U.S. economy shrank for a second straight quarter, which has renewed many Americans' concerns that a recession could be coming.

To be clear, we're not officially in a recession just yet. The National Bureau of Economic Research (NBER) is responsible for deciding when the country is in a recession, and it looks at factors such as the labor market, consumer spending, worker incomes, and GDP to determine when to make the call.

Despite the slowing economy, the NBER has not declared a recession yet. While nobody knows when or if it might happen, it may be wise to start preparing just in case. Here's how it could affect your retirement.

Two people sitting at a table looking at documents.

Image source: Getty Images.

How a recession could affect your savings

The biggest concern retirees and soon-to-be retirees may have about a potential recession is its on your savings.

The stock market will often (but not always) see a significant decline during a recession. That means your retirement fund could take a hit, and your portfolio may lose value.

Coupled with rising inflation, a recession could make it more challenging to make ends meet in retirement. When the costs of everyday goods and services are rising but your savings are losing value, it will be especially important to spend wisely in retirement.

Social Security and other fixed sources of income, such as a pension, can help during economic downturns. But depending on how much you're earning, you may still need to cut back on your spending to avoid draining your retirement fund too quickly.

In some cases, it may make sense to work an extra year or two. Not only will this strategy give you more time to save, but you can also avoid pulling money from your retirement fund when the stock market is down.

Steps you can take to prepare

A recession doesn't have to spell disaster for your retirement plans. With the right strategy, you can protect your savings as much as possible.

One way to safeguard your retirement fund is to double-check your asset allocation. As you get older, your portfolio should gradually shift toward the conservative side -- meaning it's wise to invest more heavily in bonds and less in stocks.

Bonds see lower average returns than stocks, but they're also less affected by market volatility. If we face a recession and the stock market drops, a more conservative asset allocation can help cushion the blow.

A well-diversified portfolio can also protect your savings. Not all stocks will be able to recover from a downturn. But when your portfolio contains at least 25 to 30 stocks from a variety of industries, there's a much better chance your investments will bounce back even if one or two stocks don't survive.

Nobody knows for certain when or if we'll experience a recession, but it's wise to start preparing anyway. By taking steps to protect your investments and heading into retirement with a strategy, you'll be ready regardless of what happens.