COVID-19 has been battering the U.S. economy for a solid month now, and millions of Americans have lost their jobs in its wake. Still, millennials are fairly confident about their job-related prospects, reports LinkedIn, because they feel they not only have enough work experience to maintain job security, but are also convinced they'll bounce back pretty easily if they are, indeed, let go at their jobs.

Baby boomers, not shockingly, are the least confident in this regard. While older workers certainly have their share of experience, recovering from a layoff can be far more difficult if you're on the cusp of retirement.

Older man at computer typing on keyboard


So what should you do if you're near the end of your career but aren't ready to retire and are worried you'll be laid off? Here are a few steps you can take.

1. Boost your emergency fund

In today's shaky economy, layoffs are inevitable. No matter your age, it's important to have a solid emergency fund -- enough cash in the bank to pay for three to six months of expenses in the absence of a paycheck.

Now if you're older, you may have the option to tap your retirement savings if you need money, since IRA and 401(k) withdrawals can be taken penalty-free once you turn 59 1/2. But just because you're allowed to access that money doesn't mean you should.

If you're in your early 60s and don't want to retire for another few years, removing funds from a retirement plan could cause a shortfall later in life, since you'll lose the option to keep that money invested for added growth. And also, unless you have a decent amount of your IRA or 401(k) in cash, you may have to sell investments at a loss if you're forced to take withdrawals to pay your bills. As such, it pays to have a solid emergency fund at the ready, and so if you're not laid off yet and are short on near-term savings, make every effort to sock away as much as you can from each paycheck.

Incidentally, it's smart to have enough of your IRA or 401(k) in cash to pay at least a year's worth of bills once you're very close to retirement. If that's not the case, consider shifting things around in your retirement plan once doing so won't involve financial losses.

2. Boost your job skills

It's easy to grow complacent on the job when you're older and you're only planning to stay in the workforce a few more years. But if you make an effort to get better at your job, you may end up securing your spot there should things get worse and your employer is forced to let people go. Think about the skills you're lacking in, and make an effort to get better at them. If you're stuck at home, an online class could be an easily accessible, and affordable, option right now.

3. Map out a plan for doing your job independently

Now may not be the time to go out and start your own business -- but it certainly doesn't hurt to start thinking about what that setup might look like. If you're laid off by your current employer and are already in your 60s, you may have a hard time getting hired elsewhere, but if you're able to venture out independently, you might manage to retain your paycheck and stay in the workforce a few more years rather than get forced into early retirement.

Imagine you work for an accounting firm and are worried you'll be let go if the COVID-19 crisis is prolonged. If that's the case, you may be able to offer your services on a freelance basis to small businesses, or partner up with a couple of professionals in a similar boat to yours and start your own company. You don't have to rush to take action just yet, but put some ideas in motion and have conversations with like-minded individuals who may share the same concerns as you.

The idea of getting laid off right now is scary no matter your age, but if you're on the older side, it can be even more daunting. Take steps to protect yourself, because a little extra peace of mind could go a long way toward preserving your mental health right now.