I have two things to disclose.
Okay, firing is a bit dramatic. Mostly I do layoffs. This technically means that the position is being eliminated and it's nothing personal. Of course, it doesn't feel like it's not personal when you are the person being told, "it's not you, it's the company."
Truth be told? In most cases you can avoid being laid off by getting the right job in the first place. In some cases you can do everything (and I do mean everything) right and still get laid off. That's just pure bad luck and I'm really sorry about it. It happens to the best of people and it really stinks.
But let's try to approach your goal of not getting laid off from the job search angle.
First, research the companies you are applying to. What is their history of layoffs? How is their stock (if they are public) doing? If you apply to a company that is in a downward spiral, don't be surprised when you are kicked out the door a year or so later.
Second, find out what your proposed department is doing. How has their productivity and revenue stream been over the past year or so? How is the turnover? Why is the position you are applying for vacant? If there are three positions available in a 10 person department you really want to know why. If those are 3 new positions, great! The department is growing. If three people have quit within the last month, this is a bad sign. Something is wrong in the department.
It could be a bad manager. It could be a new manager and the old guard didn't like the regime change. But, it could be bad things are on the horizon and they wanted to jump ship while there was room on the lifeboat.
Third, make sure you are good "fit." Personality counts in business. (Whether it should or not is another post entirely.) A manager that you see eye to eye with is less likely to lay you off.
Fourth, make sure your position is valued. I have a friend who received an "average" rating at year end. Knowing she had not done average work, she asked her boss for an explanation. "[Your role] isn't important to the department, so I'll never rate you above average." Now, this manager was surely out of line, but that was the reality. You bet that if that manager has to start cutting heads, my friend is the first one out the door.
Fifth, is there room for growth, advancement, and lateral moves? You want a job with room to grow. If you can't grow you'll be plucked before long. It's a sad truth of business.
Sixth, does the department offer developmental opportunities? See above. No development? No career future.
Seventh, can this job be easily outsourced? Some jobs can be. I'm not telling you not to take one, just warning you that it might be. Any job that is strictly transactional is a potential target. IT jobs are particularly vulnerable. A potential solution? Get a job with the vendor. Not saying it's perfect job security (personally, I think the outsourcing craze will end within the next 10 years), but it's a thought.
Hasn't this been a cheery discussion on job searching? Of course, some times you just need a job and a job now that will last a year and provide you severance is better than no job for the next year. Sometimes, the things you can learn from a company will outweigh the risks. Just know the risks.
And hopefully, once safely in your new career, you'll be able to walk by us Evil HR types with confidence-you know that package in my hand isn't for you.