Several large companies have announced job cuts recently in response to softening demand and a shift away from the abnormal economic conditions created by the Covid-19 pandemic. Amazon, Alphabet, Microsoft and others have all announced thousands of layoffs in recent months as companies adjust to rapid interest rate hikes by the Federal Reserve and concerns about a possible recession.

Losing your job is a jarring experience and will force you to answer some difficult financial questions, such as how you’ll replace your income and other benefits such as healthcare. Investing for the future may be the last thing on your mind if you’ve been laid off, but making mistakes with your investments following a job loss may only compound your problems later on.

Here are some tips on how to manage your investments and finances following the loss of your job.

Tips for managing your money when unemployed

File for unemployment benefits

The biggest challenge after losing your job is replacing the lost income, so you’ll want to file for unemployment benefits as soon as you can. These payments can help bridge the gap until you find a new position and can limit the extent you’ll need to rely on your own savings and investments to pay expenses in the near term.

You’ll also want to consider how your healthcare coverage will change following the loss of your job. You’ll likely have the option to continue coverage from your current employer through COBRA, but the premiums will likely be significantly higher than they were when you were employed. You may be better off finding an alternative plan.

Tap your emergency fund

How you manage your finances while unemployed will rely to some extent on how you managed them prior to losing your job. If you were able to build up an emergency fund, now may be the time to tap it, if you need to. Experts recommend having three to six months (or sometimes more) of expenses saved for unexpected events, such as losing your job.

These savings can help cover what unemployment benefits don’t and help you maintain your lifestyle while you’re looking for your next job. Once you’ve started your new position, you can start saving to replenish what you used from the emergency fund during the time you weren’t working.

Avoid 401(k) and IRA withdrawals

While you may be tempted to make early withdrawals from retirement accounts such as 401(k)s and IRAs, it’s best to avoid this if possible. Withdrawals made prior to retirement age from these plans will require you to pay taxes as well as a 10 percent penalty, though there are exceptions. Keeping your money invested will help it to grow and compound over time, making it more likely that you’ll have enough money once you do reach retirement age.

If you have a Roth IRA, your contributions can be withdrawn at any time tax-free because they were made with after-tax dollars. These kinds of withdrawals aren’t ideal either because they interrupt the compounding process, but they can be a last resort if you don’t have other options.

Once you start a new job, you can rollover your retirement plan from your previous employer into the new employer’s plan, or into an IRA, which will give you even more investment options.

Reduce investment risk

If you don’t have an emergency fund or think you may need to tap into money invested in a brokerage account, it may make sense to reduce your investment risk in that account. Selling riskier investments to raise cash you think you may need in the coming weeks and months can be a solid strategy to get you through your period of unemployment. Before deciding which assets to sell, keep in mind that you’ll need to pay taxes on any gains in these accounts.

Some people may think they can make up for their lost income by trading more or using risky products such as options. But this strategy is not likely to be successful and could make your situation worse. When you’ve lost your job, you may still have a willingness to take risk, but your ability to take risk has likely declined.

Bottom line

Preparing for the possibility of unemployment by building an emergency fund will help you greatly in the event you actually suffer an unexpected job loss. These savings can help you with expenses that unemployment benefits don’t cover and reduce the need to sell investments. Try to avoid tapping into retirement accounts by making early withdrawals and resist the urge to take on new investment risk in the hopes of replacing lost income.

By carefully managing your money through a period of short-term unemployment, you can maintain your long-term investment strategy and make it more likely that you’ll achieve your ultimate investment goals.