To show oneself as grateful.
David’s Psalm for Giving Grateful Praise
"Make a joyful noise to the Lord, all the earth! Serve the Lord with gladness! Come into his presence with singing! Know that the Lord is God! It is he who made us, and we are his; we are his people, and the sheep of his pasture. Enter his gates with thanksgiving, and his courts with praise! Give thanks to him; bless his name! For the Lord is good; his steadfast love endures forever, and his faithfulness to all generations." PSALM 100:1-5
In the entire book of Psalms, David praised God, regardless of what he was facing or struggling with. This passage alone shows his devotion and gratitude to the Lord in spite of his trials and doubt.
In return, this teaches us that, no matter what happens, it’s important to give thanks. Be grateful for everything, and rejoice in God’s name for he is our Creator and our Almighty Father.
[Available from http://www.jesuswalk.com/psalms/psalms-12-thankfulness.htm]