King David was a just man who committed a terrible sin, committing adultery with the wife of Uriah and then murdering Uriah. And he paid a terrible price for this sin:
David said to Nathan, ‘I have sinned against Yahweh.’ Nathan then said to David, ‘Yahweh, for his part, forgives your sin; you are not to die. But, since you have outraged Yahweh by doing this, the child born to you will die.’ (2 Samuel 12:13–14, NJB)
To know that your child will die because you sinned: could anything be worse? But yet this was not the end of it, because strife was a further consequence:
For this, your household will never be free of the sword, since you showed contempt for me and took the wife of Uriah the Hittite, to make her your wife.” ‘Yahweh says this, “Out of your own household I shall raise misfortune for you. Before your very eyes I shall take your wives and give them to your neighbour, who will lie with your wives in broad daylight. You have worked in secret, but I shall work this for all Israel to see, in broad daylight.” ’ (2 Samuel 12:10–12)
But yet our God is a great God, whose purposes not only are not thwarted by human evil but whose purposes are even confirmed and advanced when He turns human evil to great good. Because Bathsheba’s next son (after the one who died as a result of David’s sin) was Solomon, one of Israel’s greatest kings; and through him was the birth of our Lord Jesus Christ: a good infinitely greater than the worst thing that David ever did. And of course there is also the story of Jacob’s son Joseph, whose brothers sold him into slavery, as a result of which Joseph was in a position to be a savior both to them and to many others (Genesis 50:20).
God is good, and His goodness is so great that even the worst evils perpetrated by men may be turned by Him into occasions for good. That doesn’t excuse the evil, of course, but it does mean that when we trust God in the difficult times in our lives we do not do so in vain.