6 At the mouth of two witnesses, or three witnesses, shall he who is to die be put to death; at the mouth of one witness he shall not be put to death. 7 The hand of the witnesses shall be first on him to put him to death, and afterward the hand of all the people. So you shall put away the evil from the midst of you.

8 If there arises a matter too hard for you in judgment, between blood and blood, between plea and plea, and between stroke and stroke, being matters of controversy within your gates; then you shall arise, and go up to the place which Yahweh your God shall choose; 9 and you shall come to the priests the Levites, and to the judge who shall be in those days: and you shall inquire; and they shall show you the sentence of judgment. 10 You shall do according to the tenor of the sentence which they shall show you from that place which Yahweh shall choose; and you shall observe to do according to all that they shall teach you: 11 according to the tenor of the law which they shall teach you, and according to the judgment which they shall tell you, you shall do; you shall not turn aside from the sentence which they shall show you, to the right hand, nor to the left. 12 The man who does presumptuously, in not listening to the priest who stands to minister there before Yahweh your God, or to the judge, even that man shall die: and 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.