Just as a hammer and high heat are used to forge instruments of iron, God uses trials to develop genuine faith and strength of character in us.
1 Peter 1:6-7
In this you greatly rejoice, though now for a little while you may have had to suffer grief in all kinds of trials. These have come so that your faith—of greater worth than gold, which perishes even though refined by fire—may be proved genuine and may result in praise, glory and honor when Jesus Christ is revealed. (NIV)