The eye can be compared to a camera to understand the simple functions. Most cameras have several single lenses grouped together to focus the light on the film. The eye is just the same. Most people don't realize the cornea focuses most of the light coming into the eye and the lens contributes about a third of the focusing of the light. When the image is focused on the retina it is upside down and inverted just like occurs in a camera.

Normal Eye

The light from a point is focused to a sharp point on the retina.

Farsighted Eye

The light from a point is focused to a sharp point behind the retina.

Farsighted Eye Corrected

The light is now focused sharply on the retina.

Nearsighted Eye

The light from a point is focused to a sharp point in front of the retina.

Nearsighted Eye Corrected

The light is now focused sharply on the retina.

Astigmatism

Because the eye is more of a football shape, parts of the light are focused in front and behind the retina, or other combinations.

Astigmatism Corrected

With a lens that counteracts the football shape the light is focused to a sharp point on the retina.