A question that comes up ion any casual discussion with someone leading a team of any size is how to handle firing someone. The simple fact is that in over 25 years in senior management (CEO, CTO, and lots of VP and Director positions) I've had to fire less than a dozen people total, and of that three were for purely disciplinary reasons (stealing being the primary issue). Of course, layoffs are a different and entirely unsatisfactory situation I'll deal with in another posting.
My first question when it comes to having to fire someone (other than for disciplinary reasons) is "how did we fail in this person?) I always ask them "What can I do to help you succeed?" to better understand whether the mistake is ours to fix or not. Maybe changing roles, groups, or responsibilities will make a major change and it's our responsibility to do that for them. Both for their sake and the company's, as we invested a lot in these people and if we can convert them to useful employees, we save money, improve morale, and show we care.
Naturally, there are many reasons why someone is not performing up to expected standards and hence is subject to action. Someone might be having a rough time for personal reasons (divorce or health issues, for example), and they can often be given enough time to work the issue through, then they become a productive employee again (often more motivated than before because they know you've supported them in rough times). Sometimes the person hasn't got the knowledge required for a new task, and they were afraid to make this obvious. Training, support, and encouragement solve these problems. Sometimes it's interpersonal skills either with their peers of someone above or below them in the management chain. Again, finding the problem and addressing it is often easy, and shows the employee you really care and, as a result, you get a more dedicated and motivated employee (and they rub off on others!). In short, whenever there is a valid reason for why someone is not "up to scratch", it's the manager's job to figure this out and correct it, and not simply terminate an employee without making the effort.
Of course, there are times when motivation or interest has waned, and it is time to part company. usually, the employee already knows it is time, and a mutual separation on good terms can be arranged.
Of the three people I had to let go because of non-correctable issues, none have been ugly situations. Personally, I think that's because I try very hard to make the effort and not simply write someone off before terminating. On the other hand, I may have just been lucky.