Gold is purified by fire. It is the heat of the flame that separates the impurities from the pure gold. The fire takes nothing from the property of the gold, nor decreases its value. In a similar way, testing times are used to purify our hearts.
Commit your way to the LORD; trust in him and he will do this: He will make your righteousness shine like the dawn, the justice of your cause like the noonday sun. Psalm 37:5-6