I've had to lay off or fire quite a few people over the years. I've even been laid off or fired a few times too. In each case, it's never easy, but there are things you can do to help the situation.
When laying off or firing someone, the one thing I hate saying is "your services are no longer required", getting the answer "why?", and not responding. Yet some companies insist that we do not give reasons, for fear of legal action. I find this to be difficult to work with, and I don't like this approach at all (although sometimes I have to toe the corporate line). A much better approach is to explain to the person being let go why they are being let go. It helps their peace of mind and their acceptance of the situation.
The easiest case to deal with is when someone is fired and you have clear reasons for it. I find it helps them understand (and prevent recurrence) if they know why they are being dismissed. If it's for a breach of contract (stealing, cheating, showing up late consistently, whatever the reason), explaining the reason helps them understand. Sure, it will invite explanations, but the easy answer to that is "sorry, but the decision is made". If they want to fight it, you have to be able to justify the action anyway, so might as well be upfront and get it over with. If they are being fired because of laziness or lack of attention to detail, explaining this to them helps them focus more on their next position.
Laying people off is never easy, and it's hard for most laid off employees to understand why them. In these cases, I try to be as honest as I can. I explain the company or group is going through a trimming for budget reasons, that they are not alone in this action, and if there is a good reason why they were selected I explain it to them. Perhaps their project was cancelled. Perhaps their last appraisal was not very good. Perhaps there's some interpersonal issue. Whatever the reason, I try to lay it out nicely, without blaming or accusing, and that way the laid off can understand what is happening.
The simple fact is these people are all professionals and there are always jobs out there for them. They can find other work eventually. And we, as a company, do not HAVE to keep them employed if they are not doing what we need, or if they are costing us too much. We do not have a legal requirement to keep everyone in their job regardless. Our main legal requirement is that if we let them go we treat them fairly and offer some separation compensation. Sure, some will run to a labor lawyer and demand more, and that's to be expected in any company, but as long as we do things right there's no reason we can't let anyone go for any reason (or even no reason).
What I object to about the "your services are no longer required" line is that it offers nothing for the person being laid off. I know in my case, I heard this once, and spent months wondering what I'd done wrong. Turns out, I later found out, that I had done nothing wrong and it was just a realignment, but I spent months of angst in the meantime and swore I'd never do that to anyone else if I had any options. Yeah, the line may help deflect legal challenges, and I can respect that to some degree, but we must never forget these are former colleagues and professionals. They deserve respect even if being terminated.