The first recommendation I have is to talk about this issue with your optometrist
in advance, explaining that you have anxiety
about the exam and have had trouble completing it in the past. It may be that your optometrist will be able to walk you through the examination, perhaps by letting you know step by step what is going on so you don't get anxious, or by distracting you with small talk. Most people who have anxiety about the examination are able to get through it just fine with these simple strategies.
In more severe cases, especially where the test is medically very important (for example, if you have diabetes or another condition that puts you at high risk of eye problems), then it may be necessary to involve your primary care doctor
. Your primary care doctor may be willing to prescribe you a small one time dose of an anti-anxiety medications so that you can get through the test. This would not be unlike the prescription of these medications for those with a bad fear of flying who need to travel by airplane.
Start with talking to your optometrist, however, to see what they recommend that you do. Good luck!