Ponder these verses from
2 My brethren, count it all joy when ye fall into divers temptations;
3 Knowing this, that the trying of your faith worketh patience.
4 But let patience have her perfect work, that ye may be perfect and entire, wanting nothing.
5 If any of you lack wisdom, let him ask of God, that giveth to all men liberally, and upbraideth not; and it shall be given him.
6 But let him ask in faith, nothing wavering. For he that wavereth is like a wave of the sea driven with the wind and tossed.
7 For let not that man think that he shall receive any thing of the Lord.
12 Blessed is the man that endureth temptation: for when he is tried, he shall receive the crown of life, which the Lord hath promised to them that love him.
17 Every good gift and every perfect gift is from above, and cometh down from the Father of lights, with whom is no variableness, neither shadow of turning.
What do these verses teach you about the connection between gratitude and overcoming trials?