True, it is a commandment:
"And in nothing doth man offend God, or against none is his wrath kindled, save those who confess not his hand in al things, and obey not his commandments." (Doctrine & Covenants 59:21)
But for me it is more than that. I like to list my blessings--many at once or one or two in particular at various times. However, there is something vastly different when I pray to my Father and list those blessings, talk about them with Him, and thank Him for them. It is a precious and important time between my Father and me. I know my Father loves to bless me with what is (or eventually will be) for my good. Acknowledging His hand in my life is, for one, a humbling act on my part. But it also is an expression of my love for my Father and for what He does for me.
In every prayer, I try to include my gratitude for things. Especially if I have need to ask for something. I don't want Father to think I'm greedy. Yet a few years ago after October 2008 General Conference, I started to have Gratitude Prayers on occasion because of a story Elder Bednar shared in his talk. What his family learned is what I have come to learn, so I thought I would share his exact words:
During our service at Brigham Young University–Idaho, Sister Bednar and I frequently hosted General Authorities in our home. Our family learned an important lesson about meaningful prayer as we knelt to pray one evening with a member of the Quorum of the Twelve Apostles.
As we strive to make our prayers more meaningful, we should remember that “in nothing doth man offend God, or against none is his wrath kindled, save those who confess not his hand in all things, and obey not his commandments” (D&C 59:21). Let me recommend that periodically you and I offer a prayer in which we only give thanks and express gratitude. Ask for nothing; simply let our souls rejoice and strive to communicate appreciation with all the energy of our hearts.
I can testify that Gratitude Prayers are powerful, sustaining, humbling, and sweet. That gratitude in prayers is not only polite, but the kindest thing to do if you are a child of God who loves their Father.