Ḥadīth No. 18 — Guard Your Heart, Correct Your Deeds, Perfect Your Character

‌عَنْ ‌أَبِي ‌ذَرٍّ، ‌جُنْدُبِ ‌بْنِ ‌جُنَادَةَ، ‌وَأَبِي ‌عَبْدِ ‌الرَّحْمَنِ، ‌مُعَاذِ بْنِ جَبَلٍ رَضِيَ اللَّهُ عَنْهُمَا عَنْ رَسُولِ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ قَالَ:
«اتَّقِ اللَّهَ حَيْثُمَا كُنْت، وَأَتْبِعْ السَّيِّئَةَ الْحَسَنَةَ تَمْحُهَا، وَخَالِقْ النَّاسَ بِخُلُقٍ حَسَنٍ».  
[قال الترمذي: حديث حسن] - [رواه الترمذي] - [الأربعون النووية: 18]

Translation

On the authority of Abū Dharr Jundub ibn Junādah and Abū ʿAbd al-Raḥmān Muʿādh ibn Jabal رضي الله عنهما, from the Messenger of Allah , who said:

“Be mindful of Allah wherever you are. Follow up a bad deed with a good one—it will erase it. And interact with people with good character.”
(Reported by al-Tirmidhī, who said: ḥadīth ḥasan. In some narrations: ḥasan ṣaḥīḥ.)[1]

About the narrator Abū Dharr al-Ghifārī رضي الله عنه

Abū Dharr Jundub ibn Junādah al-Ghifārī رضي الله عنه, as recorded by al-Ḥāfiẓ Ibn Ḥajar in al-Iṣābah fī Tamyīz al-Ṣaḥābah, belonged to Banū Ghifār, a branch of Kinānah, thus sharing lineage with the Prophet . He was among the earliest to embrace Islam, arriving in Makkah and accepting the faith at a time when only three had preceded him—making him the fourth in Islam[2]. Upon his acceptance, the Prophet instructed him: “Return to your people and inform them until my command reaches you.” Yet Abū Dharr, driven by unwavering conviction, replied: “By the One in Whose Hand is my soul, I will proclaim it openly among them.” He then went to the Sacred Mosque and declared loudly: “Ashhadu an lā ilāha illa Allāh, wa anna Muḥammadan ʿabduhu wa rasūluh.” The Quraysh rose against him and beat him severely until he fell unconscious, but al-ʿAbbās ibn ʿAbd al-Muṭṭalib intervened, reminding them of his tribal ties and their dependence on Ghifār’s route to Shām, thereby saving him. The next day, he repeated the same act and was again assaulted, only to be rescued once more by al-ʿAbbās.

After this, he returned to his people and remained there until the Prophet migrated to Madinah. Although he did not participate in Badr and Uḥud due to this delay, he later joined the Prophet and stayed close to him thereafter. Abū Dharr held a special place in the heart of the Messenger , who honoured him in his presence and enquired about him in his absence. He was distinguished by profound zuhd (asceticism) and detachment from worldly life. Reflecting this, he narrated that the Prophet said: “The closest of you to me on the Day of Resurrection is the one who leaves this world in the same state as when I left him.” He would then remark with striking honesty: “By Allah, there is none among you except that he has clung to something of the world—except me.”[3]

The Prophet bore testimony to his unmatched truthfulness, saying:

«ما أقلّت الغبراء ولا أظلّت الخضراء أصدق لهجة من أبي ذر»
“The earth has not carried, nor the sky shaded, anyone more truthful in speech than Abū Dharr.”[4]

He was also among the companions who narrated a significant number of aḥādīth: two hundred and eighty-one narrations are reported from him; al-Bukhārī and Muslim agreed upon twelve of them, while al-Bukhārī reported two independently, and Muslim seventeen.[5]

It is also reported that the Prophet said:

“May Allah have mercy on Abū Dharr—he will live alone, die alone, and be resurrected alone.”[6]

This statement became a reality, as he passed away in al-Rabadhah in the year 31 AH, a remote place a few miles from Madinah. His funeral was attended by a small group, among them ʿAbdullāh ibn Masʿūd رضي الله عنه. Thus, Abū Dharr رضي الله عنه lived a life defined by truth, courage, and renunciation—walking a path that was solitary in this world, yet elevated in the sight of Allah. والله أعلم.

We will explore about the Muʿādh ibn Jabal, another narrator of this hadith, in another hadith.

The Significance and Rank of This Ḥadīth

Before entering into the detailed explanation of the three commands contained in this ḥadīth, it is important to recognise its central place within the Sharīʿah. This ḥadīth is a complete framework for a Muslim’s relationship with Allah and with people.

Al-Ḥāfiẓ Ibn Ḥajar al-Haytamī رحمه الله said:

“This ḥadīth encompasses all the rulings of the Sharīʿah, for they do not go beyond commands and prohibitions. Thus, it is the entirety of Islam, as it contains what is included in the ḥadīth of Jibrīl—Īmān, Islām, and Iḥsān.”[7]

Al-Manāwī رحمه الله further emphasised its comprehensive nature:

“This ḥadīth is among the important foundational principles, as it clarifies the good of both worlds. It includes what is required of a person in fulfilling the rights of Allah and the rights of creation. Some scholars said: it encompasses all rulings of the Sharīʿah, nothing falls outside it. Others said: it presents a remarkable structure—three principles, each comprehensive in its domain, arranged in a sequence where each builds upon the previous.”[8]

Ibn ʿAllān al-Ṣiddīqī رحمه الله highlighted its depth in relation to taqwā:

“This is from the concise speech (jawāmiʿ al-kalim) of the Prophet . Taqwā, though brief in wording, encompasses all the rights of Allah—by avoiding every prohibition and fulfilling every command. Whoever does so is among the muttaqūn whom Allah has honoured in His Book with various forms of excellence.”[9]

 

If one looks closely, this ḥadīth outlines an entire life system:

  • اتق الله حيثما كنت → Your connection with Allah
  • وأتبع السيئة الحسنة تمحها → Your relationship with your own self
  • وخالق الناس بخلق حسن → Your relationship with people

It is as if the Prophet is saying: Stay grounded with Allah, keep correcting yourself, and be gentle with people, and you will not lose your way.

First Principle: Be Mindful of Allah Wherever You Are

The statement of the Prophet , اتقِ اللَّه (Be mindful of Allah), is built upon the root meaning of taqwā, which is wiqāyah—to place a shield between oneself and what one fears. Thus, the taqwā of a servant is to place a barrier between himself and the anger of Allah by fulfilling His commands and avoiding His prohibitions. This is why the Qur’ān directs this command towards the greatest matter to be feared: {اتَّقُوا اللَّهَ}, meaning His anger, for from it arises punishment in this world and the Hereafter. Allah further reminds: {وَيُحَذِّرُكُمُ اللَّهُ نَفْسَهُ} and {هُوَ أَهْلُ التَّقْوَى وَأَهْلُ الْمَغْفِرَةِ}, indicating that He alone is worthy of being feared—and He alone grants forgiveness.

The Prophet clarified this meaning in a profound ḥadīth qudsī:

«أنا أهل أن أُتقى، فمن اتقاني فلم يجعل معي إلها آخر، فأنا أهل أن أغفر له»
“I am most worthy to be feared; whoever fears Me and does not associate anything with Me—I am most worthy to forgive him.”[10]

Taqwā is sometimes connected to consequences and reminders, such as: {وَاتَّقُوا النَّارَ} and {وَاتَّقُوا يَوْمًا تُرْجَعُونَ فِيهِ إِلَى اللَّهِ}, all of which direct the heart toward vigilance and accountability.

The second part of the command, حيثما كنت (wherever you are), expands taqwā from a limited act into a constant state. It is not restricted to a place, time, or audience—it is required in public and private, in ease and hardship, in visibility and secrecy. The believer is not driven by the sight of people, but by the awareness of Allah, as He says:

{إِنَّ اللَّهَ كَانَ عَلَيْكُمْ رَقِيبًا}
“Indeed, Allah is ever Watchful over you.”

For this reason, the Prophet advised Abū Dharr رضي الله عنه:: “Have taqwā of Allah in your secret and your open,”[11] and would supplicate: “I ask You for Your fear in the unseen and the seen.”[12] This is among the qualities that save a person.

And this quality—khashyah in both the hidden and the apparent—is counted among the munjiyāt (the qualities that save a person).

At the heart of this is a deep inner realisation: that Allah sees you at all times. The Prophet said to Muʿādh رضي الله عنه:

“Have modesty before Allah as a man would feel before a respected member of his family.”[13]

This is an inner feeling born of awareness of Allah's presence. When a servant knows that Allah is watching him—his public and private, his actions and even his thoughts—this awareness naturally leads him to abandon sins, especially those committed in secrecy.

The true test of taqwā, therefore, is not in public—where eyes are watching—but in khulwah (seclusion), where only Allah sees. The early generations captured this meaning beautifully. Some of the Salaf would say:

“May Allah grant us and you detachment from ḥarām like the one who has full ability in private, yet leaves it knowing that Allah sees him.”

Imām al-Shāfiʿī رحمه الله said:

“The most difficult things are three: generosity in poverty, waraʿ (piety) in seclusion, and speaking the truth before one who is hoped or feared.”[14]

Notice how waraʿ in seclusion is singled out—it is easy to appear righteous in front of people, but sincerity is proven when no one is watching.

Al-Ḥārith al-Muḥāsibī رحمه الله defined this state in a single line:

“Murāqabah is the heart’s knowledge of the nearness of the Lord.”[15]

And when this settles in the heart, it transforms behaviour. Al-Junayd رحمه الله was asked: “What helps a person lower his gaze?” He replied:

“Your knowledge that Allah’s gaze upon you precedes your gaze upon what you look at.”[16]

Imām Aḥmad رحمه الله expressed this meaning poetically[17]:

إذا ما خلوت الدهر يوماً فلا تقل
خلوت ولكن قل عليّ رقيب

ولا تحسبن الله يغفل ساعة
ولا أن ما يخفى عليه يغيب

“If ever you are alone, do not say: I am alone—
But say: Over me is a Watcher.
And never think that Allah is heedless for even a moment,
Nor that anything hidden from Him can escape.”
Bottom of Form

This brief command is from the jawāmiʿ al-kalim—concise words carrying vast meanings. Though short, taqwā encompasses all the rights of Allah: that He is obeyed and not disobeyed, remembered and not forgotten, thanked and not denied. This is understood within one’s capacity, as Allah تعالى says:

{فَاتَّقُوا اللَّهَ مَا اسْتَطَعْتُمْ}
Meaning: strive to obey and avoid disobedience according to your ability.

From this comprehensive meaning, taqwā naturally includes the fulfilment of all duties and avoidance of all prohibitions. Thus, it becomes the source of all the good in both this world and the next. Allah تعالى has attached immense fruits to it:

  • Strength and firmness:
    {وَإِنْ تَصْبِرُوا وَتَتَّقُوا فَإِنَّ ذَلِكَ مِنْ عَزْمِ الْأُمُورِ}
  • Protection from harm:
    {لَا يَضُرُّكُمْ كَيْدُهُمْ شَيْئًا}
  • Divine support:
    {إِنَّ اللَّهَ مَعَ الَّذِينَ اتَّقَوْا}
  • Relief and provision:
    {وَمَنْ يَتَّقِ اللَّهَ يَجْعَلْ لَهُ مَخْرَجًا • وَيَرْزُقْهُ مِنْ حَيْثُ لَا يَحْتَسِبُ}
    About this, the Prophet said to Abū Dharr: “If all people were to take this verse, it would suffice them.”
  • Acceptance and forgiveness:
    {يُصْلِحْ لَكُمْ أَعْمَالَكُمْ وَيَغْفِرْ لَكُمْ ذُنُوبَكُمْ}
  • Light and guidance:
    {وَيَجْعَلْ لَكُمْ نُورًا تَمْشُونَ بِهِ}
  • Honour and elevation:
    {إِنَّ أَكْرَمَكُمْ عِنْدَ اللَّهِ أَتْقَاكُمْ}
  • Salvation and eternal success:
    {ثُمَّ نُنَجِّي الَّذِينَ اتَّقَوْا},
    {أُعِدَّتْ لِلْمُتَّقِينَ}

At its peak, taqwā leads to the greatest attainment:

{اللَّهُ يُحِبُّ الْمُتَّقِينَ}
Once a person attains the love of Allah, he attains everything.

The early scholars understood taqwā as something deeper than outward compliance—it is refined caution and inner vigilance. Sufyān al-Thawrī رحمه الله said: “They were called muttaqūn because they avoided even what may not seem avoidable.” Al-Ḥasan al-Baṣrī رحمه الله said: “They continued in taqwā until they left much of what is permissible, fearing it may lead to the impermissible.” And Abū al-Dardāʾ رضي الله عنه said: “The completion of taqwā is that a servant fears Allah even in matters as small as an atom, and leaves some of what he sees as permissible fearing it may be impermissible.”

This meaning is rooted in the Prophetic guidance:

“A servant will not reach the level of the muttaqīn until he leaves what is harmless out of fear of what is harmful,”[18]
and:
“Whoever avoids doubtful matters has safeguarded his religion and honour.”[19]

In essence, taqwā is not merely fear—it is a constant awareness that governs the heart, guides actions, and refines character. It is the unseen awareness that keeps a person upright when no one is watching. It is the foundation upon which the rest of this ḥadīth stands—because once a person is right with Allah, correcting oneself and dealing well with people becomes a natural extension of that awareness.

Follow a Bad Deed with a Good One

After commanding the servant to uphold taqwā in both public and private, the Prophet , with profound wisdom, acknowledges a human reality: no matter how careful a person is, shortcomings will occur. A servant may fall into lapses, by leaving a command or committing a prohibition—yet this does not strip him of the quality of taqwā, as long as he returns and corrects himself. This meaning is reflected in the Qur’ān when describing the muttaqīn:

{… وَالَّذِينَ إِذَا فَعَلُوا فَاحِشَةً أَوْ ظَلَمُوا أَنْفُسَهُمْ ذَكَرُوا اللَّهَ فَاسْتَغْفَرُوا لِذُنُوبِهِمْ}

(…And those who, when they commit an immoral act or wrong themselves, remember Allah and seek forgiveness for their sins)

For this reason, the Prophet said:
وأتبع السيئة الحسنة تمحها“Follow a bad deed with a good one; it will erase it.”

This aligns directly with the divine principle:

{إِنَّ الْحَسَنَاتِ يُذْهِبْنَ السَّيِّئَاتِ}
“Indeed, good deeds remove bad deeds.”

The occasion of revelation itself gives life to this meaning. In the Ṣaḥīḥayn, Ibn Masʿūd رضي الله عنه reported that a man kissed a woman unlawfully and came to the Prophet in remorse. The Prophet remained silent until this verse was revealed, then recited it to him. When someone asked, “Is this specific to him?” the Prophet replied:

“Rather, it is for all people.”[20]

Similarly, in another narration, a man came confessing a sin deserving punishment, yet the Prophet did not interrogate him. When the man prayed with the Prophet , he was told:

“Did you not pray with us?”
He replied: “Yes.”
The Prophet said: “Allah has forgiven your sin.”[21]

In another report:

“You have left your sin as the day your mother gave birth to you—so do not return to it.”

This shows a beautiful balance in Islam: accountability without despair, and hope without negligence.

Although the texts clearly show that good deeds erase sins, scholars have explained that this applies mainly to:

  • Minor sins related to the rights of Allah

As for major sins, they are not erased by general good deeds alone. They require specific repentance (tawbah) with its proper conditions. Likewise, sins involving the rights of others are not removed simply by prayer or charity—they require returning the rights or seeking forgiveness from those affected.

This understanding comes from other authentic sayings of the Prophet , such as:

“The five daily prayers, Friday to Friday, and Ramadan to Ramadan erase what is between them—so long as major sins are avoided.”[22]

And:

“No Muslim attends an obligatory prayer, perfecting its purification, humility, and bowing, except that it becomes an expiation for previous sins—so long as he does not commit a major sin.”[23]

Imām al-Nawawī explained, narrating from Qāḍī ʿIyāḍ:

“This forgiveness mentioned in the hadith—provided major sins are avoided—is the position of ahlu sunnah: that major sins are only erased through repentance, or by the mercy and grace of Allah.”[24]

This part of the ḥadīth teaches us a powerful mindset:

  • Do not let sin define you
  • Do not let guilt paralyse you
  • Do not delay your return

Instead: fall, rise, and move forward—immediately.

Deal with People with Good Character

The Prophet concluded this comprehensive advice with the command: وخالق الناس بخلق حسن (Deal with people with good character). This completes the framework of the ḥadīth—after establishing one’s relationship with Allah and correcting one’s own self, it turns to how one lives with others.

The essence of good character, as summarised by the scholars and reported by al-Tirmidhī and others, revolves around three core qualities:

  • A cheerful and welcoming face
  • Refraining from harming others
  • Extending goodness and kindness to them

Some scholars further explained it as: controlling anger for the sake of Allah, showing gentleness and warmth (except where firmness is required), forgiving those who err (except where justice must be upheld), and avoiding harm towards all—Muslim or non-Muslim—except in the context of removing wrongdoing or restoring rights without transgression.

In a simple yet powerful expression, it has been summarised as:

“Treat people the way you would love to be treated.”[25]

When this is lived sincerely, hearts unite, inner and outer states align, and a person becomes safe from others' harm.

The Sunnah is filled with praise for noble character, showing its immense weight in Islam:

  • “Nothing will be heavier on the scale than good character.”[26]
  • “The best of believers in faith are those best in character.” [27]
  • “The best thing a Muslim is given is good character.” [28]
  • “Shall I not tell you who are most beloved to Allah and closest to me on the Day of Judgment? Those with the best character.”[29]

And among the highest forms of character:

“To maintain ties with those who cut you off, to give to those who withhold from you, and to pardon those who wrong you.”[30]

This shows that true character is not tested in ease—but in difficulty.

Good character may be partly natural—something a person is created with—but it is also something that can be developed and refined. This is why the Prophet commanded it. If it were purely fixed and unchangeable, such a command would not make sense. Rather, its foundation may be natural, but its expression and refinement are acquired.

A person can cultivate good character through:

  • Reflecting on the character of the Prophet and following his example
  • Keeping the company of people known for good character
  • Purifying oneself from blameworthy traits
  • Training the soul gradually until noble qualities become natural

In this way, a person is rewarded—not merely for what they are born with, but for how they strive to refine themselves.

Although good character is part of taqwā, it is mentioned separately in this ḥadīth to correct a common imbalance. Some people focus intensely on acts of worship and their relationship with Allah, yet neglect the rights of others. This ḥadīth reminds us that true righteousness lies in combining both.

Ibn Hajar Al-Hytami notes[31] that gathering between the rights of Allah and the rights of people is rare—achieved only by the most complete individuals, like the Prophets and the truthful.

Final Words

This comprehensive advice of the Prophet was not delivered in isolation, but in meaningful contexts that reflect its depth and practicality. It was first given to Abū Dharr رضي الله عنه when he came to the Prophet in Makkah while the Prophet was still calling secretly. After accepting Islam, Abū Dharr desired to remain with the Prophet out of love and eagerness to learn. However, the Prophet , knowing his situation and what would benefit him more, instructed him to return to his people so that Allah might bring benefit to them through him. It was on this occasion that he advised him with these comprehensive words:
“Be mindful of Allah wherever you are…”

The same advice was also given to Muʿādh ibn Jabal رضي الله عنه when the Prophet sent him to Yemen as a teacher and judge. In such a role—dealing with people, making decisions, and representing the dīn—this guidance becomes even more essential.

Muʿādh رضي الله عنه truly embodied this advice. It is reported that when ʿUmar ibn al-Khaṭṭāb رضي الله عنه later appointed him to a position of responsibility, he returned from his service without bringing back any wealth. His wife questioned him about this, and he replied: “I had a watcher over me,” meaning Allah سبحانه وتعالى. She thought he meant that ʿUmar had assigned someone to monitor him and went to complain about it to the people.[32]

This incident beautifully reflects the essence of the ḥadīth—living with taqwā even when no human authority is watching, and maintaining integrity purely out of awareness of Allah.

 

References:

[1] Al-Tirmidhī, Sunan al-Tirmidhī, ḥadīth no. 1987

[2] Ibn Ḥibbān, Ṣaḥīḥ Ibn Ḥibbān, ḥadīth no. 7134

[3] Ibn Abī Shaybah, al-Muṣannaf

[4] Al-Ḥākim, al-Mustadrak ʿalā al-Ṣaḥīḥayn, ḥadīth no. 5513

[5] Al-Haytamī, al-Fatḥ al-Mubīn bi-Sharḥ al-Arbaʿīn, p. 349

[6] Al-Ḥākim, al-Mustadrak ʿalā al-Ṣaḥīḥayn, narration of ʿAbdullāh ibn Masʿūd (raḍiyallāhu ʿanhu)

[7] Al-Haytamī, al-Fatḥ al-Mubīn, p. 150

[8] Al-Manāwī, Fayḍ al-Qadīr, vol. 1, p. 157, ḥadīth no. 115

[9] Ibn ʿAllān, Dalīl al-Fāliḥīn Sharḥ Riyāḍ al-Ṣāliḥīn, vol. 1, p. 230, ḥadīth no. 61

[10] Al-Tirmidhī, ḥadīth no. 3328; Ibn Mājah, ḥadīth no. 4299; Aḥmad, Musnad, ḥadīth no. 12442

[11] Aḥmad ibn Ḥanbal, al-Musnad, vol. 5, p. 181

[12] Ibn Ḥibbān, ḥadīth no. 1971; al-Ḥākim, al-Mustadrak, vol. 1, p. 524

[13] Aḥmad ibn Ḥanbal, al-Zuhd, ḥadīth no. 248

[14] Ibn Rajab al-Ḥanbalī, Jāmiʿ al-ʿUlūm wa al-Ḥikam, p. 408.

[15] Ibn Rajab al-Ḥanbalī, Jāmiʿ al-ʿUlūm wa al-Ḥikam, p. 409

[16] Ibn Rajab al-Ḥanbalī, Jāmiʿ al-ʿUlūm wa al-Ḥikam, p. 409

[17] Ibn Rajab al-Ḥanbalī, Jāmiʿ al-ʿUlūm wa al-Ḥikam, p. 409

[18] Al-Ṭabarānī, al-Muʿjam al-Kabīr, vol. 17, p. 168, ḥadīth no. 446; al-Tirmidhī, ḥadīth no. 2451; Ibn Mājah, ḥadīth no. 4215

[19] Al-Bukhārī, Ṣaḥīḥ al-Bukhārī, ḥadīth no. 52; Muslim, Ṣaḥīḥ Muslim, ḥadīth no. 1599

[20] Al-Bukhārī, ḥadīth no. 526; Muslim, ḥadīth no. 2763

[21] Al-Bukhārī, ḥadīth no. 6823; Muslim, ḥadīth no. 2764

[22] Muslim, Ṣaḥīḥ Muslim, ḥadīth no. 233

[23] Muslim, Ṣaḥīḥ Muslim, ḥadīth no. 228

[24] Al-Nawawī, Sharḥ Ṣaḥīḥ Muslim, vol. 3, p. 466

[25] Al-Haytamī, al-Fatḥ al-Mubīn, p. 359

[26] Al-Bukhārī, ḥadīth no. 6053; Muslim, ḥadīth no. 2321

[27] Ibn Ḥibbān, ḥadīth no. 479; al-Ḥākim, vol. 1, p. 3; Abū Dāwūd, ḥadīth no. 4682

[28] Ibn Ḥibbān, ḥadīth no. 478; Ibn Mājah, ḥadīth no. 3436

[29] Ibn Ḥibbān, ḥadīth no. 485

[30] Aḥmad ibn Ḥanbal, al-Musnad, vol. 3, p. 438; al-Quḍāʿī, Musnad al-Shihāb, ḥadīth no. 1289; al-Ṭabarānī, al-Muʿjam al-Kabīr, vol. 20, p. 188

[31] Al-Haytamī, al-Fatḥ al-Mubīn, p. 362

[32] Al-Haytamī, al-Fatḥ al-Mubīn, p. 362.

Disclaimer

The views expressed in this article are the author’s own and do not necessarily mirror Islamonweb’s editorial stance.

Leave A Comment

Related Posts