The breathing technique 1 to 2 (or 1 to 3) helps well - a quick deep breath and a slow exhalation - for example, we count in the head - we inhale "one-two", exhale "one-two-three-four- (five-six ) "- focusing on breathing and going into ourselves, we cut off external stimuli and this helps to concentrate. tested in hundreds of situations - works.
I would recommend that you think about whether you have a social phobia. Social anxiety disorder is manifested by increased anxiety and fear in certain social situations that one wants to avoid in every possible way. There is a Libovitz scale LSAS, you can go through it online. If my assumption is correct, then it is worth getting rid of it with a psychologist or a psychotherapist who owns the methods of cognitive-behavioral therapy. If there is no social phobia, then everything is solved even easier.
Several principles helped me get a red diploma.
If the exam is "passing", then it is better to spend more time during the semester, establish yourself in front of the teacher and do everything to keep the exam to a minimum.
If the exam is a "mid-term" exam, then immediately before it all forces should be devoted to perfecting all knowledge and tasks. Ideally, get the tasks from the past years and solve everything.
If neither one nor the other works, then this exam does not need to be passed at all. It turns out to postpone - well, it doesn't work - to pass in accordance with GOST and score. You can still retake more often later.
Keep track of your thoughts, keep the flow under control. As soon as the thought leaves the topic, immediately return it to the desired topic. Well, if the panic has already begun, shift your attention to the window. Think about how the landscape outside the window could help you solve the exam problem. As absurd as it sounds, 2 of my classmates pulled themselves together and finished the exam, although the case already smelled like hysteria. One found inspiration in the clear blue sky, the other just relaxed. There was an exam in Russian. Both are written in 4, by the way.
I am 16 years old