I know, it's not quite that easy. But you can take a few steps to ensure that the odds are in your favor. When companies look to cut costs and, subsequently, people, they look at who's generating the most revenue. Are you having a positive impact on the company's bottom line? Be sure that you're working on important projects, and ask your boss if you can take on additional responsibilities. The key is to seem indispensable.
When all else fails, it doesn't hurt to have a headhunter at your fingertips in case so you can take action quickly in case things go wrong. And networking, always key to getting and keeping a good job, is even more important now. Show up to events, join an association—the idea is to keep your name and face fresh in the minds of decisionmakers.