Failure arrives in life, whether you are prepared for it or not. In particular. I am referring mostly to failures when it comes to academics, some people have the fortune that they do not have to experience any failures but most people obviously do. In these instances, one has to stand tall act accordingly.
There is nothing wrong with moaning said failure for a bit, it's natural to feel bad, but that cannot last forever. One has to pass it and figure out what to do because that is your reality. That failure happened and you have to figure out what to do in response. Form a plan to deal with the situation you now find yourself in. After all, it is what it is.