The Pasuk says (Shemos 21:26) "If a man hits the eye of his servant or the eye of his maidservant and damages it, to freedom he shall send him in place of his eye".
When a person can’t control what he looks at he becomes a slave to the Yetzer Hara. But the Pasuk is telling us that if we break the koach of the eye through Shmiras Einayim, we will find real FREEDOM from all our obsessions and be able to serve Hashem properly. Through the merit of Shmiras Einayim alone, a person can reach true freedom in Avodas Hashem.
But the Pasuk says “Yakeh” which means “hit”. Because at first it feels painful to turn away, but we must accept this pain with azus of Kedusha, until, over time it becomes second nature to turn away. As Yehudah Ben Teima says: “Kal Kanesher – be light as an eagle” – and it says in the Tur Shulchan Aruch (Siman Alef) that this is referring to shmiras einayim.
Note also that the pasuk says "eye" and not "eyes". Hashem doesn't ask us to give up our eyesight completely. Aderaba, we need our eyesight to be able to serve Hashem properly; to be able to work, be good parents, good spouses, good Jews, learn Torah and appreciate the beauty of Hashem’s world. Hashem only asks us to break one aspect of our eyesight - like a person who is blind in one eye and can still do 99% of things he needs to do. Hashem asks us only to give up taking pleasure through our eyesight from things that we shouldn't. And with this alone, we can be zoche to "go free" from the painful servitude of the Yetzer Hara and be zoche to serve Hashem with joy!