Usually people give thanks when they have something beneficial for them, while they forget to give thanks when they are faced with trials. If you believe God gives us only what is good for us, you will give thanks in any kind of trials. When you are weak, you can give thanks to God who strengthens and perfects the weak, and when you are faced with difficulties, you can believe and rely on God who will cause all things to work together for good and blessing of your life. Then God will answer you and guide you to the way of blessing according to your faith because He saw you give thanks in any kind of situation.
"Oh give thanks to the LORD, for He is good, for His lovingkindness is everlasting" (Psalm 107:1).