This is usually a symptom of stress or anxiety, which can be managed using calming strategies. First, approach the anxiety on a physical level by taking some long, deep breaths. Then let your mind relax – close your eyes, if you like, and give yourself an opportunity to calm down.
If your mind goes blank just as you start answering a question, wind back and think about the topic more broadly, scribbling down anything that comes to mind. This should jog your memory. If not, skip the question and come back to it later. You will eventually remember as your mind is prompted by other material on the exam, and you don't want to waste time worrying.
If you find this happens regularly during exams, you might want to contact the Monash University Counselling Service for advice on managing stress and anxiety.