Here’s one way to think about these situations.
If you’ve ever worked at refinishing a cabinet or chair or some other item, you know that to make new paint stick you might need to apply some sandpaper and elbow grease. You need to rough up the surface to ensure the paint adheres, all those tiny grooves creating surface area for the paint to find purchase.
I think that’s sometimes what God is doing for us. Sanctification is like a refurb project, and the experiences that seem so abrasive and hurtful are God’s way of ensuring grace adheres. God roughs up our surfaces to make his grace stick.
The fifth-century Egyptian ascetic known as Mark the Monk put it this way: “Look to the end of every involuntary suffering, and you will find in it removal of sins.” We endure pain and wrongs and hardship to find that God has used them to purify us, to transform us.
James tells us, “Count it all joy, my brethren, when you meet various trials, for you know that the testing of your faith produces steadfastness. And let steadfastness have its full effect, that you may be perfect and complete, lacking in nothing” (1.2-4).