Leviticus 24:14-16

24:14 “Bring the one who cursed outside the camp, and all who heard him are to lay their hands on his head, and the whole congregation is to stone him to death. 24:15 Moreover, you are to tell the Israelites, ‘If any man curses his God he will bear responsibility for his sin, 24:16 and one who misuses the name of the Lord must surely be put to death. The whole congregation must surely stone him, whether he is a foreigner or a native citizen; when he misuses the Name he must be put to death.

Leviticus 24:23

24:23 Then Moses spoke to the Israelites and they brought the one who cursed outside the camp and stoned him with stones. So the Israelites did just as the Lord had commanded Moses.