I will try to use my cheering up skills to the max...
Do you know if you definitely failed? Have you actually had the result back yet? If not, then honestly do not worry a single thing. I've had a Chemistry exam before where I was convinced I got a U because I left 10 questions out and I still somehow got a C (it was a mock thank God but you get my point I hope). Often they go a lot better than you expect. And if you did get your result back, then hey, hopefully you will know how to improve on it next time. Nobody is perfect and everybody will go through zones like this. Doesn't mean you can't get back up on your feet and improve your skills.
And at least you have one shot than no shot. Make it count, my friend! Prroooove that grade wrong!
You only get one shot! (bad time to make a boyband reference)
...I work better when I'm not under pressure okay ._.