This verse refers to the last one that talks about being in heaviness through manifold temptations. These trials that we go through have a purpose. What are they trying? They are trying our faith. The purpose of these trials is to refine our faith, that it might praise and honor and glorify Christ at His appearing.
The reference to gold and being tried with fire is a reference to the refining of gold. The gold is put into a big melting pot over a fire. It heated until it liquefies. When this happens the impurities rise to the top where they can be skimmed off. The refiner sits by the fire and keeps the temperature at just the right place so as not to ruin the gold, but high enough to cause these impurities to rise up so he can skim them off. When the refiner can see his own reflection in the gold, then he has finished refining it.
This is Peter telling us that our faith is much more precious than gold and these trials are the fire by which it is tried. The goal is that Jesus Christ, the Refiner, would see His own reflection in us at His appearing and that our lives would reflect the praise, honor and glory due to His name.
Whom having not seen, ye love; in whom, though now ye see him not, yet believing, ye rejoice with joy unspeakable and full of glory: Receiving the end of your faith, even the salvation of your souls. (1 Peter 1:8-9)
I can't help but wonder if Peter was around at the time Hebrews was written. These two verses remind me so much of Hebrews 11:1
Now faith is the substance of things hoped for, the evidence of things not seen. (Hebrews 11:1 KJV)
Faith and hope are intertwined. Remember 1 Peter 1:3? We have been begotten unto a lively hope! Verses 8-9 are referring that hope mentioned in verse 3. Even though we might be weighed down with heaviness in our spirits, we can still rejoice because we know that we will be saved from this world at the appearing of Jesus Christ.