Discipline your son, for there is hope; do not set your heart on putting him to death.
Proverbs 19:18 ESV

"Do not set your heart" doesn't mean "don't make it your goal to kill your son". It means "don't make up your mind that there is no hope and your son is lost forever". As long as he's alive, there's hope.

The KJV translates the Hebrew word mut as "crying", but it actually means death as the ESV has it. On the other hand, the ESV translates nephesh as "heart", when it actually means soul, life, or being. "Heart" still captures the intended meaning, though.