It’s always hard to deal with grades we perceive as failure. It’s disappointing and painful and can make us question a lot about ourselves. The first thing is to feel the feelings and do activities that you enjoy. But you also have to practice being kind to yourself. You’re still intelligent, you’re still capable and worthy of success, and you still have potential. This time didn’t go as you wanted but that doesn’t mean the future can’t go well. I’m really sorry it hasn’t gone as you wanted, please find someone to talk to about it and don’t be harsh on yourself for having a strong emotional reaction. Look after yourself, and you’ve got whatever it is that comes next.