Hello
Not advisable to medicate yourself with any new medication right before the exam that you have never tried before.
It would be better if you attempt at sleep hygiene.
Cut down on all stimulants - like tea, coffee, cold drinks etc and even digital stimulants like cell phone before sleeping.
Try natural methods to induce sleep instead.
Next Steps
Try sleep hygiene. As you know the reason is due to anxiety.