The S&P 500 fell into a bear market in June 2022 as investors fretted about rising interest rates and high inflation. Since then, the market has recovered to reach new highs, with the bear market lasting 282 days, according to Hartford Funds. A bear market is generally defined as a 20 percent decline from a recent high and they can be unnerving for investors.

Bear markets are inevitable for long-term investors, so knowing how to handle them is important if you’re going to be successful. But how you should navigate them depends on where you are in your investing journey. Someone saving for retirement in their 20s should view a bear market much differently from someone who has already retired or is about to retire.

Here’s what you should know about how to survive a bear market at any stage of your investing life.

How to survive a bear market in your 20s and 30s

If you’re saving and investing for a long-term goal such as retirement, a bear market during your 20s or 30s can actually be a blessing in disguise. No one knows how long a bear market will last, but when you still have decades to recover from the temporary losses, it shouldn’t be a major concern.

In fact, the decline in stock prices gives you the opportunity to invest additional money at more attractive prices. If you’re already contributing to a workplace retirement plan such as a 401(k), then you’ll benefit from the lower prices as you make consistent purchases through the plan. A bear market could also be a good time to boost your contributions or make additional contributions through another retirement account such as a traditional or Roth IRA.

However, before you boost your investments during a bear market, it’s a good idea to make sure you have an emergency fund in place. Bear markets often coincide with some amount of economic difficulty, either a slowdown or a recession, which may lead to job losses for some workers. Experts typically recommend having three to six months worth of expenses set aside in an emergency fund.

How to survive a bear market in your 40s and 50s

As you move from the early part of your career to the middle, retirement might stop feeling like something that is decades away and start feeling more like something that is on the horizon. A bear market can be more scary during this time because you might have been getting close to your savings goal and now you see the portfolio value fall by 20 percent or more.

But remember, you still have a lot of time until you reach a normal retirement age of about 65 years old. If you still have 10 or 15 years to make up for today’s losses, that’s plenty of time to get back on track and still reach your goal.

Try not to panic and rush to move savings out of stocks in an attempt to time the market. That strategy is likely not what got you to where you are today, so there’s no need to change your approach now. Your portfolio allocation should shift gradually away from riskier assets such as stocks the closer you get to retirement, and toward fixed-income assets such as bonds. If you haven’t made that shift already, a bear market could be a little wake-up call to start making that change.

Just as in your 20s and 30s, there’s also an opportunity to take advantage of the downturn by boosting your contributions to retirement accounts. Lower prices typically mean higher expected returns going forward, so contributing more money during a bear market can help to more than make up for what you’ve lost recently.

How to survive a bear market in your 60s or during retirement

Bear markets are challenging no matter when they come, but they can be particularly unsettling for people who are about to retire or for those that already have. When you’re working, you have regular income coming in from your job that can help soften the blow of a declining market. But once you’ve retired, you’re relying on that portfolio for your income, so a bear market can take a financial and psychological toll.

One way to lessen the impact of a bear market during retirement is to make sure you’re holding a portion of your overall portfolio in cash or investments considered very safe, such as money-market funds or government bond funds. If you can, make withdrawals from these safer assets during a bear market to avoid locking in losses you’re experiencing in the stock market. Once the market has recovered, you can resume withdrawals from stocks and start to replenish the investments in safer assets.

Another option is to reduce your spending as much as you can during a bear market. This will allow you to withdraw less money from your portfolio when prices are down. Cutting spending isn’t easy, but it may help you sleep better and get you through a period of high volatility.

If you find that the bear market is hitting your portfolio particularly hard, it may also make sense to review your overall asset allocation. People who are close to or in retirement should have more of their investments in low-risk assets and less in riskier options such as stocks. If you find you have too much allocated to stocks, it may make sense to reduce your exposure, even if it means locking in losses.

It may also make sense to work with a financial advisor who works in your best interest – here’s how to find one.

Bottom line

Bear markets are a normal part of investing, so they shouldn’t come as a surprise. Once you realize that you’re in one, they may actually be close to being over, so do your best not to make any panicked decisions. Maintain a long-term mindset if you’re at the beginning or mid-point of your career and remember that volatility is part of investing in stocks.

If you’re already retired or close to it, focus on making withdrawals from cash-like investments and consider reviewing your portfolio allocations to see if you have too much exposure to stocks.