Ophthalmologists are eye doctors who’ve gone through four years of medical school to become a doctor (M.D.), and then four or more years of residency in ophthalmology (eye specialty). They can diagnose eye diseases, treat eye diseases, legally prescribe any medications they want, and perform eye surgery. The surgery they perform is extremely fine, so in a sense they are plastic surgeons. Some ophthalmologists specialize in particular eye diseases, like glaucoma, retinal conditions, etc. They can obviously evaluate vision and prescribe eye glasses, but that’s not their main concern, and they charge extra for it.
Optometrists are eye doctors, but not M.D.’s. They completed college and then studied four more years to become doctors of optometry (O.D.’s). Their main job is to assess and measure vision, and prescribe eye glasses. They perform excellent eye exams, and make diagnoses about the eye, but can only prescribe a limited number of medicines all of which are related to eye disease (varies by state). They might perform a very few limited types of eye procedures in some states.
Opticians make eye glasses and contact lenses, using prescriptions from Ophthalmologists and Optometrists. They’re technicians, not doctors, so they can’t diagnose or prescribe anything. Many have only completed high school.
If you only need glasses, go to an optometrist. Even if you have another type of eye problem, the optometrist will figure out if you need to see an ophthalmologist (who costs lots more). If you’re over 40 and only need glasses to read, the cheapest thing is to go to a local pharmacy or supermarket, try on a bunch of reading glasses, and buy the ones that seem best.