Unbelievers might expect us to praise God when things go well. And well we should! God deserves all the praise for every good and perfect gift: it comes down from the Father of lights with whom there is no shadow of change (cf. James 1:17). But in the throes of suffering we offer praise to God it's as though a candle has been lit in the darkest of night. It brings light to all. Fellow believers are encouraged. Unbelievers surely take notice.
This is no call to seek hardship and suffering. But it is a reminder to us that when we praise God in the midst of suffering we show our faith to be pure and good. And we light a candle of hope for all to see.