What's the difference?
Now you would be surprised how often the subject of eye doctors comes up in conversation with students of English. And even I am sometimes unsure as to who does what precisely. So here are the definitions.
An ophthalmologist is a doctor/physician. They are, effectively, the true eye doctor, but their job is basically to check your eyes when there's something not right with them, and not necessarily to check on the quality of your eyesight as regards seeing things clearly and sharply. These could be defects (partial blindness and cataracts, for example) or diseases or anything that is making your eye(s) poorly. They are also qualified to perform surgery on your eyes if necessary.
Now an optician is actually a person who makes and sells you your pair of glasses and contact lenses.
Now I've got two more titles to add.
An ophthalmologist optician is the person that is qualified to ask you to place your head into some kind of electronic device and then rest your eyes against some kind of electronic reader. You are then asked to read those boards of letters that start big and then get smaller and smaller, then at the point you can't read them they then decide if you need glasses and then write a prescription.
The person who then supplies you with your glasses and lenses is called a dispensing optician.