Light passes through the cornea of the eye, which is the clear tissue covering the iris and pupil. The cornea bends (refracts) the light. The light then passes through the pupil, then the lens, which sits behind the pupil. The lens further refracts the light rays. In the perfect eye, the light rays would come to a focus just as they reach the retina, in the back of the eye.
Nearsightedness (myopia), farsightedness (hyperopia), and astigmatism are refractive errors of the eye - the reason some of us need to wear eyeglasses or contacts - or have refractive surgery. These refractive errors occur because the cornea and/or lens bend the light too much, or too little, to focus the light onto the retina, or because the eyeball is too long or too short for the "strength" of focusing of the cornea and lens.
Technically called myopia. Nearsighted people have trouble seeing clearly in the distance without glasses or contacts, but close up objects are clear. This occurs because the cornea and/or lens focus the light rays "too much", or the eyeball is too long, so the light rays come to a focus, and go back out of focus again, before hitting the retina.
Also known as hyperopia. A hyperopic person has more trouble seeing objects up close without glasses or contacts. The cornea and/or lens do not focus light strongly enough, or the eyeball is too short, for the light rays to come to a focus before hitting the retina.
Astigmatism can occur by itself, or with myopia or hyperopia. It occurs when the cornea doesn’t have a perfectly rounded or spherical shape, but rather is just a little oblong or "egg" shaped. Most eyes have some astigmatism.