Ibn al-Qayyim (may Allah have mercy on him) said:
Gratitude may be in the heart, in submission and humility; in the tongue, in praise and acknowledgement; and in the physical faculties, by means of obedience and submission.
Madaarij al-Saalikeen (2/246)
The details of that:
1. Gratitude of the heart: what is meant is that the heart senses the value of the blessings that Allah has bestowed upon His slave, and fully acknowledges that the one who has bestowed these great blessings is Allah alone, with no partner or associate. Allah says (interpretation of the meaning):
“And whatever of blessings and good things you have, it is from Allah”[Quran 16:53].
Allah says, describing the situation of one who denies attribution of blessings to Allah (interpretation of the meaning):
“They recognise the Grace of Allah, yet they deny it (by worshipping others besides Allah) and most of them are disbelievers (deny the Prophethood of Muhammad)”[16:83].
Ibn Katheer (may Allah have mercy on him) said:
They acknowledge that Allah is the One Who grants them that, and He is the One Who bestows that favour upon them, yet despite that they deny it, and worship others alongside Him, and attribute victory and provision to someone other than Him. Tafseer Ibn Katheer (4/592).
2. As for gratitude of the tongue, it means acknowledging verbally – after believing in the heart- that the One Who grants blessing is indeed Allah, and keeping the tongue busy with praise of Allah, may He be glorified and exalted.
Allah says, explaining His blessings to His slave Muhammad (blessings and peace of Allah be upon him): “And He found you poor and made you rich (self‑sufficient with self‑contentment)?” [Quran 93:8]. Then He reminded him in return for that: “And proclaim the grace of your Lord (i.e. the Prophethood and all other graces)” [al-Duha 93:11].
Ibn Katheer (may Allah have mercy on him) said:
As you were poor and in need, then Allah made you rich and independent of means: then speak of the blessing of Allah bestowed upon you. Tafseer Ibn Katheer (8/427).
It was narrated that Anas ibn Malik said: the Messenger of Allah (blessings and peace of Allah be upon him) said: “Allah is pleased with a person who eats some food and then praises Him for it, or who drinks some drink and then praises Him for it.” Narrated by Muslim
Gratitude is a means of attaining that great honour because it implies acknowledgement of the Bestower of blessings and acknowledging Him alone as the Creator of that blessing and the One Who caused it to reach the recipient of the blessing, as an honour and favour from the Bestower, and that the recipient of the blessing is poor and is in need of that blessing, and cannot do without it. So this is an acknowledgement of the rights and bounty of Allah, and the duty and need of the slave. So Allah has caused the reward for that acknowledgement to be this great honour.
Hence some of the salaf (righteous predecessors) said: Whoever conceals a blessing has denied it, but whoever manifests it and spreads it has given thanks for it.
Ibn al-Qayyim said, commenting on that:
This is based on the words: “When Allah bestows a blessing upon a person, He loves the effect of His blessing to be seen on His slave.” Madaarij al-Saalikeen (2/246).
3. Gratitude of the physical faculties means using one’s physical faculties in obedience of Allah and keeping them from committing sins and acts of disobedience that Allah has forbidden.
Allah says (interpretation of the meaning):
“ ‘Work you, O family of Dawood (David), with thanks!”” [34:13]
It was narrated that ‘Aishah said: When the Messenger of Allah (blessings and peace of Allah be upon him) prayed, he would stand for so long that his feet became swollen. ‘Aishah said: O Messenger of Allah, are you doing this when Allah has forgiven your past and future sins? He said: “O ‘Aishah, should I not be a thankful slave?” Narrated by al-Bukhari and Muslim.
Al-Tabari said: the correct view concerning that is that the person’s gratitude is affirming that this is from Allah and no one else, and affirmation of this fact is action, and it is confirmed by action. As for the affirmation which is contradicted by action, the one who does that does not deserve to be called grateful at all. But it may be called gratitude of the tongue. The evidence that this is true is the words of Allah (interpretation of the meaning): “ ‘Work you, O family of Dawood (David), with thanks!’”[Quran 34:13]. It is well known that He did not order them, when He said that to them, to affirm His blessings, because they did not deny that this was a favour from Him to them. Rather He commanded them to give thanks for His blessings by obeying Him in their actions. Similarly, the Prophet (blessings and peace of Allah be upon him), when his feet swelled up as he was praying at night, said: “Should I not be a thankful slave?”
Sharh Saheeh al-Bukhaari.
In order to be grateful to your Lord for the blessings that He has bestowed upon you, you must acknowledge in your heart that the giver of these blessings and the Bestower is Allah, may He be exalted, so you venerate Him, attribute it to Him, and you acknowledge that with your tongue, so you give thanks to Him after waking from sleep for having given new life, and after eating and drinking for having provided you with them and bestowed them upon you, and so on with every blessing that you see in your life.
You give thanks with your physical faculties by not letting them see or hear any sin or evil, such as singing or gossip; you do not walk with your feet to haram places; you do not use your hands to commit evil, such as haram writing in a relationship with non-mahram women (one whom you can marry according to Islamic law), or writing haram contracts, or making or doing anything haram. Giving thanks with the physical faculties for blessings also includes using them to obey Allah, by reading Quran and books of knowledge, listening to beneficial and useful things, and so on with all the faculties which you should use in various kinds of obedience and worship.
Remember that gratitude for blessings is a blessing which needs to be given thanks for, so that one will continue to enjoy the blessings of his Lord, thanking his Lord for those blessings and praising Him for helping him to be among those who give thanks.