Ophthalmologists are doctors of medicine, and go through years of intensive education: pre-medical course, medical school, and then internship or residency in a specialization. They can diagnose, treat, and even surgically correct vision problems.
Optometrists do not attend medical school,but must take a four-year optometry course. They can diagnose and treat vision problems such as nearsightedness, far sightedness and astigmatism. They may also be able to identify more serious conditions like cataracts and retinal disease, but will often refer you to an opthalmologist.
Opticians will fill out the lens prescriptions and fit the glasses that your opthalmologist or optometrist has recommended for you. They cannot identify vision problems.