God's work in our lives can be painful, but His ultimate goal is to transform us into something better.
Imagine yourself as a living house. God comes in to rebuild that house. At first, perhaps, you can understand what he is doing. He is getting the drains right and stopping the leaks in the roof and so on: you knew that those jobs needed doing and so you are not surprised.
But presently he starts knocking the house about in a way that hurts abominably and does not seem to make sense. What on earth is he up to? The explanation is that he is building quite a different house from the one you thought of — throwing out a new wing here, putting on an extra floor there, running up towers, making courtyards.
You thought you were going to be made into a decent little cottage: but he is building up a palace. He intends to come and live in it himself.
C.S. Lewis, in Mere Christianity