Deuteronomy 17:2-13

ISV(i) 2 Death to the Idolater“You may discover that a man or woman living in one of your cities that the LORD your God is about to give you has done evil in the eyes of the LORD your God by transgressing his covenant. 3 He may be following and serving other gods by bowing down to them—that is, to the sun, the moon, or to any of the heavenly host (something I did not command). 4 When it is reported to you or you hear of it, then investigate it thoroughly. When the truth has been established that this detestable thing has been done in Israel, 5 summon the man or the woman who did this evil thing to your city gates. Then stone the man or the woman to death. 6 Based on the testimony of two or three witnesses, they must surely die. But they are not to die based on the testimony of one person. 7 Let the witnesses be the first to begin executing them, then the rest of the people shall follow. By doing this you will purge evil from among you.”
8 Deciding Difficult Cases“If a case is too difficult for you to decide with respect to bloodshed, civil claims, assault and battery, or other matters of dispute within your courts, bring it to the place that the LORD your God will choose. 9 Present the case to the Levitical priest or the judge at that time. When you have inquired and they have announced the verdict, 10 carry out the verdict that was declared to you at the place that the LORD will choose. Carefully observe all of their instructions to you 11 in accordance with what the Law says, and in accordance with the verdict that will be handed to you. You must not deviate from the verdict that they declare to you either to the right or to the left. 12 If a man presumptuously disregards the priest who is serving the LORD your God there or the judge, that person must die so you will purge evil from Israel. 13 Then all the people who hear will be afraid and will not act presumptuously again.”