Read this passage and open each verse for the full verse feed and commentary tools.
1If there be a controversy between men, and they come to judgment, and [the judges] judge them; then they shall justify the righteous, and condemn the wicked; 2and it shall be, if the wicked man be worthy to be beaten, that the judge shall cause him to lie down, and to be beaten before his face, according to his wickedness, by number. 3Forty stripes he may give him, he shall not exceed; lest, if he should exceed, and beat him above these with many stripes, then your brother should seem vile to you.
Deuteronomy 25:1-3 (WEB)