It doesn't matter that you failed. It doesn't matter that you lost the client, the opportunity or the job. It doesn't matter that you did your best and that your best wasn't good enough. The events and circumstances that led to your failing don't matter either. There are only three things that matter now.
First, you need to derive any lessons you can from your failure. The price of an education is experience. And the price of experience is failure. What did you learn?
Second, it matters that you decide to pick yourself up, brush yourself off and step back into the arena. Your past performance isn't necessarily indicative of your future performance. Lots of people have failed countless times before finally breaking through. But to succeed in the future, you have to try again.