Firing an employee is always awful. No wonder most bosses usually postpone it as long as possible. (If you ever find that letting someone go isn't a ghastly experience, you should probably quit.)
But, I must ask the question: Can you fire someone nicely?
If the employee is leaving due to some misdemeanor, the answer is probably, 'No.' But you need to distinguish between bad work and bad people. As you explain you won't need that employee any more, stay focused on the work and the possibility that the person could still improve, albeit somewhere else.
But if, as so often happens, the employee's skills simply aren't relevant any more, then it's important to manage the exit with dignity and kindness. Your ability to do so can hugely improve your standing in the business and actually raise morale. I learned this lesson when I had to lose an early employee who had been a real trooper. He'd filled in all kinds of positions, always been willing to do whatever was asked of him. But he'd joined with a passion for customer service, our business model changed, and our needs and his dreams were no longer compatible.
I took him out to lunch and discussed his personal ambitions. He was clear in his own mind what they were and he was enthusiastic about his goals. But even as he articulated them to me, we could both see that they weren't compatible with the business. Articulating that idea became easy because it became obvious. That he had to go wasn't personal any more. It was a mutual need.
We discussed when he'd like to go. I offered to let him stay while he conducted his job search, knowing he'd find it easier to get a new position while in one. This felt like a risk--what if he stayed for months--but it wasn't. He had a new job in a matter of weeks and we sent him off to it with cheers and goodwill on both sides.
His departure wasn't a downer for the rest of the company. If anything, it persuaded everyone that great performers would always be treated well, no matter what happened. And it taught me that playing tough may be necessary sometimes, but not nearly as often as HR manuals often tell you.