“In every” event or circumstance, the Christian is to “give thanks” to God for the good He can bring out of the event, even should the event be unpleasant. The constant attitude of prayer (5:17), will help the believer to maintain gratitude in the face of adversity.
Notice that even the bad things that happen to us, are the will of God for that moment. Troubles come to teach us to lean more on Jesus. Every problem that we overcome through faith in Him, makes us stronger than we were before. Knowing all of this, how can we do less than to praise Him in all things and at all times.