This is something that will happen to you a lot in life. It’s one of the hardest things to deal with I think… When you half assed something and it fails, you’re prepared. But when you worked really hard and things don’t come together that’s so difficult. :(
I think the only thing to do in these situations is to just pick yourself up and try again.
Failures are temporary unless you allow them to become permanent by not trying again. When I used to ride horses, my riding teacher used to tell me that you only REALLY got thrown from the horse if you didn’t get up off the ground and get back on. You only really fail if you don’t lift yourself up from falling down.