Reading through all the laws of the Old Testament can be confusing. When you do, it is important to remember that when God’s people left Egypt they left the legal system of the Egyptians and the jurisdiction of any civil or criminal law code (which didn’t provide them much as slaves of the Egyptians; nevertheless they were ‘under the law’ of the land). In Exodus God was separating them out as a “nation” and they needed a criminal and civil law under which to operate as a nation. The leaders served as judges to adjudicate criminal and civil situations, and what we are reading in Exodus served as the nation’s penal code.
By NT times God’s people (in God’s plan) were no longer a single nation, but a scattered composite of people called in allegiance to Christ dispersed throughout the nations. In the NT God’s scattered people are called to live within their respective nations under their countries’ civil & criminal law codes (with the situational exception of when obedience to a nation’s particular law would violate God’s ethical or moral law). When modern Christians read the civil & criminal law codes of OT Israel, we cannot read it the same way we would read the ethical & moral instructions for God’s people in other parts of the Scripture.
The OT civil and criminal law for the fledgling state of Israel was God’s provision for a nation that didn’t have one. This is not to minimize what we can learn here. It is simply to understand that a nation’s “eye for an eye” code of justice and remunerations adjudicated by the judges of Israel should not be seen to be in conflict with the “turn the other cheek” ethics for our personal relationships and fellowship.