A lens, because of its convex or concave shape, takes a light image and spreads it or contracts it so that the focal length is altered slightly, and the image falls on the retina exactly. Near-sightedness means that the image falls in front of the retina; far-sightedness means that the image falls behind the retina. When you go to the optometrist he/she places a series of lenses in front of you (this device is called a phoropter) and tries various lenses until you can see the letters, etc. clearly. That occurs when the lens combination focuses the image exactly on your retina, not ion front of or behind it. That is your prescription. Your own eye has a lens also, and it can be altered surgically to focus the images better. Of course, contact lenses do the same thing. The principle is fairly simple, if you understand the way light works through a lens.