I fight my failures like I fight my depression, I keep going. I almost absolutely never want to get out of bed, but I get out of my bed and I do what I can, whether what I can do is take a shower, or getting something to eat, or just being up, listening to music, idling on my computer. I don't always exercise my craft. Inside, I love to write, but mentally I'm not always present and willing to lift a single finger, but being awake and recognizing that I am still here and can still accomplish anything, and not a single person or entity deserves to hinder my progress is always enough.
I seek out posts on reddit, or Tumblr, Instagram, a blog, anywhere thriving of people with their own stories to tell and similar struggles with which I am able to resonate. I'm heavy on sentimental nourishment. I eat quotes up like breakfast. Sometimes I post them, or my own tidbits of what I am going through text, and surprisingly people reach out. That helps. Even when I don't want to go on, I go on and am passively reminded that my life holds a purpose. Wounds heal, and if they're chronic, I learn to live with the pain and suppress the throbbing. I allow myself to feel and express that pain when I can't contain it, but I do not let the pain overtake me as a human being anymore. I chose to not live in a negative space, because I would rather die having made an effort to do better than to die in my own misery.
As a perfectionist, failure is hard to take. I often have to stop and remind myself that the world is not ending just because something hasn't worked out the way I thought it would. I remember that failure is the only way to really learn something and its in how we brush ourselves off and get back on the horse that our true selves are really challenged.
I like to look at failure as a lesson on how -not- to do something. Sure, it stings when you get knocked down, but you can't do great things if you don't humbling learn from the experience and try not to make the same mistakes that lead you to that failure in the first place.
As the other responses said, it's important to have a positive attitude and to learn from our failures. The learning part is where it gets tricky, though, I think. Many times people will say, "Well, that didn't work. I won't do that again." Then they move on and try something else. Great! They don't let the setback stop them but did they really learn anything from it? It's important to analyze what happened. Where did your process breakdown? Could the breakdown have been avoided? What could you have done differently? We really learn from our mistakes by asking these kinds of questions. Otherwise, we're just hopping from one thing to the next without actually gaining any new knowledge.
I used to have a lot of issues with dealing with failure because I always saw it as a direct reflection of who I was as a person. With time and a lot of inner healing, I came to accept the fact that failure in a job, relationship, goal, etc does not mean that "I" am a failure but rather that that event was not a successful one. I found that it is important to look at all the things that went "right" in the failure also, because there always are. And for the things that went wrong, it is good, as everybody else said, to use them as learning experiences to move forward.
Seriously struggling with that right now. I tend to beat myself up when I haven't succeeded at something. But what I've come to realize is that I almost feel worse about handling failure poorly than I do about not nailing the thing I wanted in the first place. I'd much rather be the sort of person who can shake it off and keep trying. So I guess that isn't really advice, but how you carry yourself through that failure is just as telling of success. Don't give up!
That being said, moping and treating yourself are also tried and true ways of working through a tough time. You don't have to bounce back right away.
Agree with the many posters that say failure is a learning opportunity. In modern society, failure is often seen as the complete and total end of something, and creates and all-or-nothing mentality. Fortunately, there are a lot of conversations happening around the importance of failure to personal growth -- a simple Google search brings up tons of relevant articles.
From my personal view, getting older really gives you the perspective you need to understand your failures. Things hurt so much in the moment, it can be hard to see how a failure could ever be a good thing. But if you look back on past failures in your life, you can identify what you learned from it and how that changed you as a person. The older you get, the more you realize that failing is not the end of the world and that time will help heal the wounds and reveal the lessons.