visual mesh glitch

I was modeling a pair of feet, i clicked on smooth shading and this happened.

I don’t know what causes it, but it’s really annoying and i want to know how to fix it.

Tab into Edit mode, A to select all, optional: W > Remove Doubles and finally Ctrl-N to recalculate the normals.
You spoiled the face normals while modeling that foot: Some are pointing inward, some are pointing outward. That shading artefacts you see is Blender trying to cope with a mesh that’s literally turning inside out and back again.