“…give thanks in all circumstances; for this is the will of God in Christ Jesus for you (1 Th 5:18).
“…giving thanks always and for everything to God the Father in the name of our Lord Jesus Christ…” (Eph 5:20).
The only thing you can’t give thanks for is sin you are about to do. What a great way to avoid falling to temptation. You can thank God for the temptation and then hide in his presence. You can thank him for giving you victory. You can thank him for keeping you and sustaining you and causing you to grow in grace. But you can’t thank him for the sin you are about to partake in.
So, make gratitude a part of who you are. Be thankful for everything, in every way. Make drawing near to God in thanksgiving your normal way of being. You can’t sin, if you thank him for everything.