Proverbs 20:30
The blueness of a wound cleanseth away evil: so do stripes the inward parts of the belly.
https://www.biblegateway.com/verse/en/Proverbs 20:30
"Corporal punishment in Solomon's time was not simply punitive but also remedial. The person undergoing punishment would learn that crime carries a harsh penalty, and he would resolve not to commit the crime again (Proverbs 19:29; 29:15). The meaning here is not entirely symbolic, but neither is it meant to encourage punishments which lead to injury.
The Bible teaches that every human being is a sinner and possesses a sin nature. Adam's sin passed upon the entire human race (Romans 5:12). But we are not just sinners by nature, we are also sinners by choice. Isaiah 53:6 explains that like sheep we have all gone astray, choosing to follow our will instead of God's. Even Christians choose to sin, but do not make sin a way of life. Often, when we sin, God uses discipline to correct us. He uses the "blows" and "strokes" of discipline to steer us away from sin and to produce righteousness in us."
https://www.bibleref.com/Proverbs/20/Proverbs-20-30.html