(There’s another version going around, but I think this is the correct quote — source.)
Afflictions work for good, as they conform us to Christ. God’s rod is a pencil to draw Christ’s image more lively upon us.
– Thomas Watson
And we know that all things work together for good to them that love God, to them who are the called according to his purpose.
For whom he did foreknow, he also did predestinate to be conformed to the image of his Son, that he might be the firstborn among many brethren.
– Scripture (Romans 8:28-29)