This is actually a recap of my earlier response to a similar question on Quora:
What you are actually experiencing is known as "exam anxiety".
I can suggest a few options to help you to relieve it:
1) Learn a simple relaxation sequence. Folks like to call it, a "meditative ritual".
For me, I like to imagine or visualise myself, with eyes closed, taking a slow-moving elevator going downward from the 21st floor [it's arbitrary!] to the ground floor of a building.
As the elevator passes each floor on the downward trip, I imagine or visualise myself watching the light on the elevator button panel changes as it passes each floor level drop.
Observe in your mind the numericals on the button panel as it changes.
Meanwhile, imagine or visualise your entire body feeling progressively relaxed as the elevator moves downward in slo-mo.
At each pass of the floor level drop, imagine or visualise yourself progressively feeling more and more relaxed in your body, until you reach the ground floor.
Imagine or visualise all your stresses disappearing as your hit the ground floor.
Take your time. Don't hurry.
2) Imagine or visualise yourself taking a slow stroll through a tunnel pathway or underpass with the seven rainbow colours, starting with Red, Orange, Yellow, Green, Blue, etc..
As you stroll, each step forward makes you feeling progressively more and more relaxed, until you have passed all the seven coloured arches.
3) Imagine or visualise a very tranquil place, which you have actually been to. It can be a park, a lake or a mountain top where you have had visited at some point of your life.
Close your eyes, and put yourself in that place.
Imagine or visualise all the serene sensory impressions of that particular place - sights, sounds, smells, tastes (morning dew, or rain drops, for example), touches, feelings, and movements of your body.
You can do either (1) or (2) or (3) even while sitting in the exam hall, waiting for the invigilators to issue the exam papers on to your desk, or well before the exam takeoff.
If you feel embarrassed, you can always do it initially in the toilet before you enter the exam hall.
Why does such a relaxation sequence works in the real world?
This is because the brain cannot tell the difference between a real experience and an imagined (or reel) experience.
Scientifically, this is the holographic nature of our brains at work (Thanks to the eminent neuroscientist Prof Karl Pribram of Stanford University!).
In the world of competitive sports, like golf and tennis, it's called "mental rehearsal".
By the way, you can combine all three practices into one, by starting with (1), and continuing with (2) and then finally (3). All in all, you should be able to complete it in less than 15 minutes, although the longer it is, the better it is for you.