Know that you're not the only one. Millions of students across the world fail sometimes, and that's okay. No one's perfect and our grades won't always be excellent.
I'd suggest you talk to your teacher on how to make the experience better. Find ways to make studying easier for you so you can ace that next test a lot better!
Good luck! You got this. :)
-UnicornFudge aka Nadia