an ophthalmologist is a medical doctor (and a surgeon as well) with a M.D. degree plus 4-5 years of residency training in eye surgery and eye medicine afterwards. Many go on to then do fellowships furthermore such as in retina or anterior eye or oculoplastics.
Optometrist is a primary care eye doctor. He/she is not a medical doctor and is not licensed to perform eye surgeries at all, including cataracts surgery. Some states in US allow them to treat minor eye diseases or sometimes glaucoma but they are not medical doctors i.e. they did not go to medical school and dont have M.D. degree. Rather they went to optometry school and have O.D. degree.
Optician is someone with training to design lens, glasses, do basic eye exams. They are not qualified to either diagnose a disease or treat it or to perform eye surgeries.
Ophthalmologist is someone whom you would want to see if you love your eyes and want to get good care. Of course I am biased here, but this is the best suggestion to any Muslim on this forum.
note: for "basic" things such as what lens to wear and what color, an ophthalmologist would simply refer you back to an optometrist
. Frankly, in the type of cases they see, deciding on what lens and what color of glasses really trivial and they should rather spend, and rightly so, their time with patients with more severe eye problems such as blindness, infections, detachments, degenerations etc. So if that is your question, dont go to an ophthalmologist.
may Allah protect us from the need to see one. when eyes and vision is at stake, it is not pleasant.