John Macarthur says this about having thankfulness when facing problems in his sermon or study, *The Thankful Prayer*:
Instead of praying to God with doubt or discontentment, the believer is to approach God in a spirit of thanksgiving. That's because God promised not to allow anything into our lives that will be too much for us to bear (1 Cor. 10:13), to work out everything for our good in the end (Rom. 8:28), and "perfect, confirm, strengthen and establish" us in the midst of our suffering (1 Pet. 5:10).
The believer is to know that all difficulties are within God's purpose and to thank Him for His available power and promises. First Peter 5:7 says, "Cast all your anxiety on him because he cares for you" (NIV). In doing so we are to be thankful for His providence, His promise of perfecting us, the glory He will receive from accomplishing His will, and for past mercies that are the promise of future blessings.
Being thankful releases us from fear and worry. The presence of worry could mean a believer doesn't understand who God is or else has a weak faith because of sin in his life. We need to trust every situation to God's sovereign control. If we understand that God will supply all our needs (Phil. 4:19) and that He knows everything about our lives (Ps. 139:3), cares about us (1 Pet. 5:7), has the power for every difficulty (Ps. 62:11), is perfecting us to be like Christ (Phil. 1:6), and that nothing escapes Him (Ps. 147:5), that will lead us to be stable, not anxious.
What a wonderful encouragement!