Homer is right. The only way to avoid failure is to do nothing. But failure has virtues, and is probably impossible to avoid (Indeed, doing nothing is a form of failure too).
There is no learning without failure. No creativity without failure. Treat everything as a prototype. Worry more about failing forward, failing early and failing often.
Yet these is no denying that going down a failed path is still no fun, even if it is a short journey. So when it happens, the most honest thing to do is deal with our feelings of disappointment, to talk about how much it sucked to have such a lousy outcome, and then turn to the learning.
There is a silver lining, however, although it hurts, there is evidence that people think more deeply and learn more after a failure than a success.