Leviticus 24:17-22 New International Version (NIV)
17 “‘Anyone who takes the life of a human being is to be put to death. 18 Anyone who takes the life of someone’s animal must make restitution—life for life. 19 Anyone who injures their neighbor is to be injured in the same manner: 20 fracture for fracture, eye for eye, tooth for tooth. The one who has inflicted the injury must suffer the same injury. 21 Whoever kills an animal must make restitution, but whoever kills a human being is to be put to death. 22 You are to have the same law for the foreigner and the native-born. I am the Lord your God.’”
This was a code to follow for the judges. It was not an endorsement for personal vengeance. This was saying that the punishment should fit the crime, but it should not go beyond.