It is a tough one brother. Here is Matthew Henry's take on it:
IV. Care is here taken that satisfaction be made for hurt done to a person, though death do not ensue, v. 18, 19. He that did the hurt must be accountable for damages, and pay, not only for the cure, but for the loss of time, to which the Jews add that he must likewise give some recompence both for the pain and for the blemish, if there were any.
V. Direction is given what should be done if a servant died by his master’s correction. This servant must not be an Israelite, but a Gentile slave, as the negroes to our planters; and it is supposed that he smite him with a rod, and not with any thing that was likely to give a mortal wound; yet, if he died under his hand, he should be punished for his cruelty, at the discretion of the judges, upon consideration of circumstances, v. 20. But, if he continued a day or two after the correction given, the master was supposed to suffer enough by losing his servant, v. 21. Our law makes the death of a servant, by his master’s reasonable beating of him, but chance-medley. Yet let all masters take heed of tyrannizing over their servants; the gospel teaches them even to forbear and moderate threatenings (Eph. 6:9), considering with holy Job, What shall I do, when God riseth up? Job 31:13–15.