When you have to conduct a layoff, you should consider your company's plans going forward. Are you expanding in some areas and shrinking in others? Which jobs will be absolutely essential in the future? Based on this information, consider which departments can be safely cut and what criteria you want to use to decide whom to keep. Once you've come up with your layoff goals -- which departments will be cut, by how much, and according to what criteria -- then individual managers can begin applying those criteria to their staff to decide who will be subject to layoff.
For more information on deciding whether to conduct layoffs and whom to lay off, see Nolo's article Making Layoff Decisions. For information on actually implementing a layoff, see Nolo's article How to Conduct a Layoff.