Millions of Americans have lost income due to COVID-19, either facing layoffs or furloughs or having their hours reduced. In fact, over the span of just three weeks, nearly 17 million U.S. adults filed for unemployment benefits.

Losing your job can result in significant financial hardship, especially if you have little to nothing stashed in an emergency fund. But there's another reason why layoffs could be particularly disastrous, and it has to do with your 401(k) plan.

Man with his head under his laptop

Image source: Getty Images.

How layoffs affect your 401(k)

Unlike other types of retirement accounts, such as traditional IRAs and Roth IRAs, your 401(k) is tied to your employer. So if you leave your job for any reason, you'll either need to roll your money over to a new retirement account or leave it in your old 401(k).

One advantage of 401(k)s is that you can borrow money from your account if you need extra cash. Unlike a 401(k) withdrawal, you won't face any penalties for taking a loan from your account, but you will need to pay the money back with interest. Because your 401(k) is tied to your employer, however, taking a loan can potentially cause problems if you lose your job.

If you have an outstanding 401(k) loan and you leave your job -- whether it's voluntary or you're laid off -- you'll typically need to pay back the entire loan amount as soon as possible. If you don't pay it back in full, you'll be considered in default and the loan will be treated as a distribution. That means if you're under age 55, you may need to pay income taxes and a 10% penalty on your outstanding loan amount.

With so many workers losing their jobs right now, this can spell disaster for those with 401(k) loans. Among those who have an outstanding 401(k) loan, the average worker borrowed around $9,900, according to Vanguard's 2019 How America Saves report. If you lose your job and can't afford to pay back your full loan amount, you may owe hundreds or even thousands of dollars in early withdrawal fees and taxes.

The CARES Act may not help as much as you think

Congress recently passed the Coronavirus Aid, Relief, and Economic Security (CARES) Act in an attempt to provide relief for individuals and businesses hit hard financially due to COVID-19.

One of the new regulations under the CARES Act is that the 10% penalty for early 401(k) withdrawals is waived, and income taxes can now be paid over three years. However, this new rule only applies to people who have taken 401(k) withdrawals to help pay for coronavirus-related expenses. So if you already had an outstanding 401(k) loan before the virus struck and end up turning that loan into a distribution when you leave your job, you may still be on the hook for paying the early withdrawal penalties.

If you're still employed and currently have a 401(k) loan, you can defer payments for one year without accruing interest under the CARES Act. Just keep in mind that if you do end up losing your job down the road, you'll still need to either repay the loan in full or consider it a withdrawal. So if you're worried your job is on shaky ground, just be prepared for what that might mean for your 401(k) loan.

You may, for example, pay back as much of your loan as you can now so you'll have a smaller outstanding balance if you do lose your job in the future. Or you may set aside a few hundred or thousand dollars to cover any early withdrawal fees you may face if you get laid off and can't repay your full loan balance. The last thing you want is to be blindsided if you lose your job and suddenly have to figure out what you're going to do with your 401(k) loan.

Times are tough for millions of households right now, especially if you lose your job unexpectedly. Having to pay back a 401(k) loan, then, can make things even more challenging. If you have a 401(k) loan, knowing what to expect if you're laid off can make these difficult times a little easier.