It's a piece of cake to be thankful when life is full of sunshine and roses but can God really expect us to give thanks for all things? Thanks for affliction? Thanks for trials? I believe this scripture clearly gives us the answer to that question!
When I was diagnosed with MS over a decade ago, I had to make a decision. Was the God I had served for almost every day of my life still good and faithful regardless of my circumstance? Had God changed? Since God's character is unchangeable then I had to conclude that only my circumstance had changed. My decision had to be, despite my diagnosis, God would remain good and faithful in my trial. Since my diagnosis happened the day before Thanksgiving, I was confronted with the realization that I had to choose to thank my God for His blessings despite my circumstances. The alternative was to allow anger to negate my thankfulness for all He had done for me; if I could not thank Him in my trial then all the years I had given Him praise would become empty rhetoric.
When you choose thankfulness through your trials, the rewards will surprise you. Thankfulness will bring you peace. Thankfulness will allow your mind to be set on the things of God and less on the things of earth. I believe Paul, the author of both scriptures, had found the secret of contentment and that secret was thankfulness.