"If a man or woman among you in one of your towns that the Lord your God will give you is discovered doing evil in the sight of the Lord your God and violating His covenant
References for Deuteronomy 17:2
and has gone to worship other gods by bowing down to the sun, moon, or all the stars in the sky-which I have forbidden-
and if you are told or hear [about it], you must investigate it thoroughly. If the report turns out to be true that this detestable thing has happened in Israel,
you must bring out to your gates that man or woman who has done this evil thing and stone them to death.
The one condemned to die is to be executed on the testimony of two or three witnesses. No one is to be executed on the testimony of a single witness.
The witnesses' hands are to be the first in putting him to death, and after that, the hands of all the people. You must purge the evil from you.