According to a recent survey by the National Association for Business Economics, seven out of 10 economists expect a recession by the end of 2021.

Even the savviest investors worry about not having enough cash on hand to cover basic expenses during a recession — let alone those who have their entire nest egg wrapped up in a volatile market. That reasonable anxiety can prompt 401(k) participants to decrease their contributions or even cash out on their retirement savings entirely.

However, the long-term harm that a panicky move may have on their ability to retire outweighs any short-term benefits.

An economic downturn may tempt investors to put even less into retirement savings while waiting for a bull market to return. On the surface, it seems like this strategy protects savings. During the last recession, personal savings as a percentage of disposal income fell from 6.4% to 3.7% between December 2008 and January 2009. With concerns about another recession growing, many investors might consider cashing out on savings in an attempt to avoid similar losses. However, because it is almost impossible to time the market, this approach is likely to backfire, further delaying their ability to save and pushing the retirement date back. Staying steady and continuing contributions during a recession is necessary to grow savings and have a solid financial footing in retirement, even just by maintaining an employer match.

Preparing for a recession

The first and most practical step to prepare for a recession is to put aside an emergency fund. If you don’t already have three to six months of living expenses in the bank, now is the time to start saving. With an emergency fund in place, you can begin to reduce or maintain current expenses wherever possible while avoiding any unneeded costs. While building an emergency fund, it’s important to consider the timing of major purchases like a car or a house. Those who rent should seek out more affordable accommodations, or at least avoid taking on higher rent if possible. With a recession looming, it is not a good time to take on additional debt.

An effective strategy for reducing expenses is putting disposable income toward paying down existing debt. Examples of disposable income include an end of year bonus or inheritance. You’ll want to put these funds toward paying down credit card debt, mortgages, or car payments while the market is strong. It can be much harder to keep up with these payments during a recession, so get ahead now.

Cutting back on splurges

There’s no need to go cold turkey, but making small incremental decisions and effective choices all add up. You work hard and want to be able to enjoy your life — you’re entitled to that — but make sure you are saving enough on the back-end to make up for any potential market downturn.

Find little ways to save money. Go on vacation, but don’t go on an international trip — go within the U.S. and travel during off-times, where you’ll save on airfare. Instead of buying a new car, purchase a “nearly new” used car. For example, if you spent $100 less a month on your car payment, ate out once less a week ($50 a week = $200 a month), and spent $200 a month less in entertainment, you would save $500 a month. That’s $6,000 a year. These kinds of sacrifices are doable for most people.

A second strategy for saving involves using new technology or trends to find new ways to save. Here are a few examples. You could cut cable and only pay for Netflix NFLX, +2.07% and Wi-Fi — better yet, if you buy your own Wi-Fi router you’ll save the $10 renting one from the cable company every month. It’s an upfront cost now that will pay off in the long run.

For online shopping, use web-based add-ons like Honey to make sure you’re taking advantage of any promo codes available. If your big splurge is taking that once-a-year big vacation, strategize using the right credit card to maximize your points for travel. To save on gas and car maintenance costs, negotiate to work from home at least a few days a week. Finally, to save on health care costs, use goodrx.com to find the cheapest pharmacy to fill a prescription.

Read: This 57-year-old sad ‘screw this’ to San Francisco and retired to Albuquerque, were she slashed her expenses by 70%

Pitfalls to avoid

Cashing out or making significant reductions to retirement savings contributions is the worst mistake you can make during a recession.

Even for experienced investors, it is almost impossible to buy back into the equity markets at the right time. When you stop contributing to your retirement savings in a recession, you are missing the chance to buy stocks at the lowest prices. You will also miss receiving your company match, which amounts to passing on free money. Stopping contributions, especially in a recession, will have a net negative effect on your overall retirement savings and plan. It’s possible that you will put your retirement date back by years.

Another tempting option in a recession is to borrow against your retirement savings. This strategy can also do more harm than good in a recession. A five-year study by the Pension Research Council at Wharton School, Borrowing from the Future: 401Ik) Plan Loans and Loan Defaults, found that almost 40% of 401(k) participants borrowed from their retirement accounts, and 20% of defined-contribution retirement plans (which include 401(k) and IRA plans) had an outstanding balance at some point in time. However, the overall rate of borrowing from retirement accounts decreased during the last major recession in 2008 and 2009. Though borrowing against retirement is common, pulling money out of a retirement account when stocks are low only ensures that you will miss out on the gains that come when the market bounces back.

Borrowing from or cashing out of a retirement plan in a recession is equivalent to selling stock at a lower price than you bought it for. It is counterproductive to retirement, even if it can help pay the bills in the short term. Stay the course on your retirement plan and avoid common recession pitfalls.

Read: Planning to sell your house to fund your retirement? Think again

The good news about a bearish market — stocks are on sale

Believe it or not, there are some upsides to a recession. Think of declining stock prices as an opportunity, like a limited-time sale. The more you contribute toward your 401(k) during a recession, the better discounts you receive on your stocks. When the market rebounds, you will reap the benefit of a rapid rise in stock prices. In a recession, saving for retirement and contributing to your 401(k) can be difficult, but the funds you save in a down market will get you much closer to retirement than those you save in a bullish market.

Weathering the storm

It is nerve-racking to watch your retirement savings decline with the stock market during a recession. However, it is important to remember that a solid investment plan accounts for periodic downturns and is built to weather them. By planning for a recession ahead of time, it is possible to reduce or maintain normal expenses before it hits. This strategy frees up funds to contribute toward retirement accounts.

Keep your investment strategy in place and maintain a long-term outlook, and your portfolio will rebound from a recession with your retirement savings intact. This will give your portfolio the best chance to bounce back when the bull market returns and will keep you on track for your retirement goals.

Nick Strain is senior wealth adviser and wealth advisory committee chair at Halbert Hargrove.