What are the ways that eyeglasses or contact lenses work to correct your vision?

Focus light. If the only problem with your vision is an uncorrected need for classes, then your eye has a focal point off the retina (the film at the back of the eye). The ;job of glasses and contacts is to readjust that focal point with its peak on the light receptive elements of the retina so there is a clear image. This compensates for your eyes inability to do this.