You’ve probably decided when you’d like to retire. Maybe you plan to work until you’re 65 so you can build up your retirement nest egg. But what would happen if your job was outsourced, or your employer closed down your branch, or your company “needed to cut costs,” and you were out of a job when you were just 61? Could you find a level of employment comparable to your old job? If you could, how long would it take you to land that job? A job loss could ambush your plans to accumulate funds for retirement and impact your ability to have healthcare coverage until you’re eligible for Medicare.

Unfortunately, the scenario above is not uncommon. A study by the Mature Market Institute (MMI) found that 54 percent of the oldest Baby Boomers retired earlier than planned, and 25 percent cited job loss as the reason they had to retire. Another 32 percent cited health reasons. And fewer than 10 percent had adequate resources for retirement (possibly because they had to retire early).

Forced retirement is a scary possibility, so here are some suggestions that can help you mitigate the risk:

Plan for retirement readiness at different stages in your life. If you were laid off today, what expenses would you need to cover? Could you get healthcare on your own, or would you need a job that offers that benefit? What could you do to ensure you have what you need? Would you need to lower your standard of living until you found a job? Once you have a plan, ask yourself the same questions about losing your job five years from now, then ten. Planning for the unexpected can ease the pain of transition.

Know your company’s severance policy. Find out what (if any) negotiating leeway you have in terms of a severance package. The information can help you prepare the plan above.

Keep your skills current. Stay sharp and learn new skills in order to remain a valuable member of your organization. If people believe you’re not contributing anymore, guess who’ll go first if they scale back?

Maintain your professional networks. If you were laid off today, where would you look for work? Stay in touch with colleagues. Make new contacts, too. Keep your resume polished.

With luck, you’ll be able to retire on your own timeline. But it’s always a good idea to plan for the worst while hoping for the best.