Praise be to Allah.
The command mentioned in the verse quoted by the questioner is a command to the Sahaabah and the believers to remember the blessings of Allah and His grace towards them, and His kindness to them in causing the defeat of their enemies and frustrating their enemies’ plots.
Ibn Katheer (may Allah have mercy on him) said:
Here Allah, may He be exalted, is speaking of His blessings, grace and kindness to His believing slaves when He averted their enemies and inflicted defeat upon them in the year when they came together and formed an alliance against them, which was the year of al-Khandaq [the Trench].
End quote from Tafseer Ibn Katheer (6/383).
When there is a command in the Qur’an to remember Allah’s blessing, what is meant is to remember it in one’s heart, by calling to mind Allah’s grace and favour in bestowing it upon His slaves; remembering it in one’s words, by speaking of it; and remembering it in one’s physical actions, by not using that blessing in ways that incur the wrath of Allah, may He be glorified and exalted.
Remembering the blessing is giving thanks for it, and may be done in one’s heart, in one’s words or in one’s actions; each of them confirms the others, unless the gratitude is false.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said, commenting on the verse (interpretation of the meaning): “And remember the favor of Allah upon you” [al-Baqarah 2:231]:
Remembering may be done in one’s heart, in one’s words and in one’s actions. Remembering it in one’s words means saying: Allah has blessed me with such and such, as Allah, may He be exalted, says (interpretation of the meaning): “But as for the favor of your Lord, report [it]” [ad-Duha 93:11]. So you should praise Allah, may He be glorified and exalted, for it by saying: O Allah, to You be praise for what you have blessed me with of wealth, or a wife, or children, and so on.
Remembering it in one’s heart is by calling it to mind and acknowledging that it is a blessing from Allah.
Remembering it in one’s actions is by striving to obey Allah, and by showing the effects of His blessing on you.
End quote from Tafseer Soorat al-Baqarah (3/132).
Al-Harawi said: What is meant by gratitude is three things: acknowledging the blessing, then appreciating the blessing, then giving praise for it.
Ibn al-Qayyim (may Allah have mercy on him) said, commenting on the words of al-Harawi:
As for acknowledging it, that means calling it to mind, realizing its significance and recognising it as a blessing in and of itself.
So acknowledging it is done in the mind.
Appreciating it means showing humility when receiving it from the Bestower, by expressing one’s need for it and acknowledging that it came to him without him deserving it and without him paying any price; rather he sees himself as being completely dependent upon Allah. This attitude shows true appreciation.
“then giving praise for it”: praise for the Bestower in connection with the blessing is of two types: general and specific.
The general type is ascribing to Him the attributes of generosity, kindness, munificence and so on.
The specific type is speaking of His blessing, and stating that it came to him from Him, as Allah, may He be exalted, says (interpretation of the meaning): “But as for the favor of your Lord, report [it]” [ad-Duha 93:11].
Regarding this reporting or speaking of the blessing that is enjoined, there are two views:
The first is that it means mentioning the blessing and speaking of it, by saying: Allah has blessed me with such and such. Muqaatil said: Give thanks for what Allah has mentioned of blessings to you in this soorah, such as helping orphans, granting guidance after misguidance, and granting self-sufficiency after poverty.
Speaking of the blessings of Allah is gratitude, as in the marfoo‘ hadith of Jaabir: “Whoever has a favour done for him, let him reciprocate, and if he cannot reciprocate, then let him praise [the person who did him the favour], for if he praises him, then he has thanked him, but if he conceals it, then he has been ungrateful towards him. And whoever pretends to have what he has not been given is like one who wears two garments of falsehood.”
[This hadith was narrated by al-Bukhaari in al-Adab al-Mufrad (215); classed as saheeh by al-Albaani].
This hadith mentions three types of people: one who is grateful for the blessing and gives praise for it; one who denies it and conceals it; and one who pretends to be one of those who were given it when that is not the case, so he pretends to have something that he was not given. In another marfoo‘ report it says: “Whoever does not give thanks for a little will not give thanks for a great deal, and whoever does not show gratitude to people has not shown gratitude to Allah. Speaking of the blessing of Allah is gratitude, and not speaking of it is ingratitude. Unity is a mercy and division is a punishment.” [Narrated by ‘Abdullah ibn Ahmad in Zawaa’id al-Musnad (18449); classed as hasan by al-Albaani].
The second view is that speaking of the blessing that is enjoined in this verse [at the end of Soorat ad-Duha, quoted above] means calling people to Allah, conveying His message and teaching the ummah. Mujaahid said: It refers to Prophethood. Az-Zajjaaj said: It means: Convey that with which you [O Prophet] have been sent, and speak of the Prophethood that Allah has bestowed upon you. Al-Kalbi said: It refers to the Qur’an, which Allah commanded him to recite.
The correct view is that it includes both types, because each of them is it a blessing for which it is enjoined to give thanks and speak of it. Manifesting it is part of being grateful for it.
End quote from Madaarij as-Saalikeen (2/237).
Ibn al-Qayyim (may Allah have mercy on him) said regarding gratitude:
It is based on three pillars: acknowledging it inwardly, speaking of it outwardly, and using it to earn the pleasure of the One Who granted it and bestowed it.
End quote from al-Waabil as-Sayyib (p. 5).
See also the answer to question no. 125984.
And Allah knows best.