In this section of scripture, the context tells us some very important things! First, this kind of thankfulness comes from being filled with the Spirit!
The real test of a thankful heart is when God says no to your plans…and that is possible when you see God as He is and yourself as you truly are – God is GOD and we are His servants.