6 Whoever is deserving of death shall be put to death on the testimony of two or three witnesses; he shall not be put to death on the testimony of one witness. 7 The hands of the witnesses shall be the first against him to put him to death, and afterward the hands of all the people. So you shall put away the evil from among you.

8 "If a matter arises which is too hard for you to judge, between degrees of guilt for bloodshed, between one judgment or another, or between one punishment or another, matters of controversy within your gates, then you shall arise and go up to the place which the Lord your God chooses. 9 And you shall come to the priests, the Levites, and to the judge there in those days, and inquire of them; they shall pronounce upon you the sentence of judgment. 10 You shall do according to the sentence which they pronounce upon you in that place which the Lord chooses. And you shall be careful to do according to all that they order you. 11 According to the sentence of the law in which they instruct you, according to the judgment which they tell you, you shall do; you shall not turn aside to the right hand or to the left from the sentence which they pronounce upon you. 12 Now the man who acts presumptuously and will not heed the priest who stands to minister there before the Lord your God, or the judge, that man shall die. So you shall put away the evil from Israel.

Matthew Henry's Commentary on Deuteronomy 17:6-12

Commentary on Deuteronomy 17:1-7

(Read Deuteronomy 17:1-7)

No creature which had any blemish was to be offered in sacrifice to God. We are thus called to remember the perfect, pure, and spotless sacrifice of Christ, and reminded to serve God with the best of our abilities, time, and possession, or our pretended obedience will be hateful to him. So great a punishment as death, so remarkable a death as stoning, must be inflicted on the Jewish idolater. Let all who in our day set up idols in their hearts, remember how God punished this crime in Israel.

Commentary on Deuteronomy 17:8-13

(Read Deuteronomy 17:8-13)

Courts of judgment were to be set up in every city. Though their judgment had not the Divine authority of an oracle, it was the judgment of wise, prudent, experienced men, and had the advantage of a Divine promise.