Be a Key to Good - Shaykh Ahsan Hanif
By Shaykh Ahsan Hanif | 2026-07-06T18:41:57.494157+00:00 | Topic: Hadith
The Hadith of Sahl ibn Sa'd: Keys of Good and Evil
رضي الله عنه وارضاه — This companion, Sahl ibn Sa'd, during the life of the Prophet ﷺ was from the youngest companions, from the youngest companions of the Ansar of Medina. And he was the last of the companions to pass away in the city of Medina after the death of the Prophet ﷺ. A young companion, but still a prolific narrator of hadith.
In this particular hadith, he narrates that the Prophet ﷺ said:
(Ibn Mājah, Hadith 237; also recorded by al-Ṭabarānī in al-Muʿjam al-Kabīr)
The Prophet ﷺ said that all of the good and all of the evil is known to Allah. Allah has knowledge of everything. His knowledge encompasses everything. Allah knows all the good that is upon this earth and in the heavens and all the evil that is upon this earth.
وَمَفَاتِيحُهَا الرِّجَالُ — But the good and the evil that we have in this world, its keys are people. Me and you. We are the keys that determine whether we do something good or we do something evil.
So the Prophet ﷺ said, طُوبَى — glad tidings and blessings — لِمَنْ جَعَلَهُ اللَّهُ مِفْتَاحًا لِلْخَيْرِ — to the one that Allah azza wa jal has made them a key to goodness — مِغْلَاقًا لِلشَّرِّ — and a lock upon evil. وَوَيْلٌ — and woe betide the one, destruction and punishment for the one — لِمَنْ جَعَلَهُ اللَّهُ مِفْتَاحًا لِلشَّرِّ مِغْلَاقًا لِلْخَيْرِ — for the one that is a key to evil and they are a lock upon good.
This hadith, like many of the hadith of our Prophet ﷺ, is concise within its words and its statements. But it is comprehensive and full of meaning.
The Meaning of Good and Evil
The Prophet ﷺ in this hadith is pointing and drawing our attention to a number of key aspects. Not least of which is this concept of good and evil. You see, we are very quick — especially in the time that we live in — to point the finger at others and to say that there is evil because of so-and-so and so-and-so.
But often within our own communities, if every person took it upon themselves the oneness and the responsibility to do what they can within themselves and for the people around them, we have control over what we can do in terms of good and evil. Allah azza wa jal has placed that ability within our hands.
When we see a situation transpire before us, when we deal with people, when we interact with others — when you come into the masjid and there's something that takes place, or you're in the supermarket, or you're on the road, or you're at home with your family — you are the one who determines whether you will be a component of good or a component of evil. That is what our Prophet ﷺ is saying. The reward in this religion is for the one who trains themselves to be a key of goodness.
Not only for themselves in terms of earning wealth and buying houses and cars and so on, but goodness in terms of benefiting others. That is the meaning of goodness in this hadith. Yes, you benefit yourselves and your families, but you're a means of good and benefit for those that are around you.
In the hadith of Abu Hurairah رضي الله عنه, collected by al-Tirmidhi, the Prophet ﷺ said:
(Jāmiʿ al-Tirmidhī, Hadith 2263)
"Shall I not inform you about the good amongst you and how different they are from the evil amongst you?" He repeated this three times to the companions. And then the Prophet ﷺ said: "The best from amongst you are those who other people hope good from them, and they know that they are safe from the evil. But the worst of you are those who others don't hope for any good from them, nor do they know — they also know — that they are not safe from the evil."
That is the definition of goodness and evil within our religion. So in the Quran, Allah subhanahu wa ta'ala gives us examples of goodness. The life of the Prophet ﷺ is full and replete with examples of goodness — being a key for good and for change.
All of us live in a community and we live in a society. We have many issues that we deal with, whether it's on an individual, personal, family level, or whether it's us as a community, whether it's our society and the problems that we have — just the social challenges that we face upon our streets with our shabab, with our youth, drugs and alcohol, and so on and so forth. And all of us know people that are involved in one way or another, to one extent, whether greater or lesser, one form or another — people who are involved in problems and issues that are illegal or harmful. You have the opportunity to be a key of good or a lock for evil. Allah subhanahu wa ta'ala has given you that ability through advice, through sincerity, through wisdom, through gentleness, through mercy, through doing the right thing.
The Example of Musa: A Key of Goodness in Madyan
Allah azza wa jal gives us an example of this in the Qur'an in the story of the Prophet of Allah, Musa alayhis salaam. Musa alayhis salaam, as Allah mentions in Surah al-Qasas, fled from Egypt. When he was a man and he was grown, as Allah mentions in the Qur'an, when he accidentally killed that Egyptian man and he fled, fearing the oppression of Pharaoh. He fled from Egypt and he came to a place called Madyan.
Allah azza wa jal mentions in Surah al-Qasas in this passage — and this is before Musa alayhis salaam becomes a Prophet of Allah, before Allah speaks to him on the mountain of al-Tur, before he's given the Torah, before he's given a message to carry back to Pharaoh. Musa alayhis salaam comes to Madyan. He's a stranger. He's a foreigner in this land. He's fearing for his own life, running and escaping from oppression.
But he comes into Madyan and he sees a situation evolving in front of him:
He saw a group of men — shepherds all of them — a group of men with their flocks of sheep going to a watering hole and using that water for their flocks. وَوَجَدَ مِن دُونِهِم مُّرْأَتَيْنِ تَذُودَانِ — But then on the side he saw two women also with their flock of sheep. But they were standing to the side, waiting for those men to finish.
So Musa alayhis salaam has a choice. He's fearing oppression, doesn't want to be known, he's escaping for his life. He's a foreigner in this land, doesn't know the customs, doesn't know what's going on. But he can see a situation and it doesn't seem right. Musa alayhis salaam has the choice to either stay away, be quiet, go and hide somewhere, not be seen — or he can try to help.
So he goes to those two women and he says, مَا خَطْبُكُمَا — "What's wrong with you?" They said: "We don't go to this watering hole until these men finish. They don't have the chivalry, they don't have the generosity, the hospitality to say to us that you're women, you go first. And we don't want to go and hustle and jostle with these men at the watering hole. So we wait. Let them finish, then we'll go." وَأَبُونَا شَيْخٌ كَبِيرٌ — "We have no men to do this for us. Our father is an elderly man."
So Musa alayhis salaam now knows what the situation is. But again he can make a choice. He can say, "Okay, that's fine. It is what it is," and he goes. Or he can do something and be a key of goodness. فَسَقَى لَهُمَا — So Allah says that he watered the flock for them. He said to those women, "I will water your flock for you." This is something that those men, the other shepherds, should have done anyway — or at least let those women go first. But when Musa alayhis salaam sees this, فَسَقَى لَهُمَا — he goes and he waters that flock of sheep for them.
So Allah azza wa jal mentions in this passage there is a result of this action from Musa alayhis salaam. Musa, who was running from oppression, didn't know where he was going, didn't know where he would go and hide or seek asylum, what his future would hold — Allah azza wa jal makes this simple act of goodness, this key of goodness, a means for him settling in Madyan. He marries one of those two women and for approximately ten years he will stay there. And it is when he leaves from Madyan that Allah azza wa jal gives him revelation and makes him a prophet of Allah subhanahu wa ta'ala. This is what the Quran teaches us: being a key for goodness.
The Example of Yusuf: A Key of Goodness in Prison
In the story of the other prophet of Allah, Yusuf alayhis salaam — when Yusuf enters into jail, into prison, two people come to him as Allah mentions:
Two young men approached him in prison. Yusuf alayhis salaam doesn't say to them, "I'm in jail, leave me alone. I have other issues to worry about." We know the story of Yusuf alayhis salaam — the oppression that he underwent from so many angles and from so many directions, the difficulty and the challenges and the trials that he faced one after the other after the other. He's in prison unjustly, being oppressed. There is no valid reason for him to be in prison.
But when those two men come and they say to him:
One of them said, "I see that I'm pouring wine for someone in my dream." And the other one said, "I see myself with bread upon my head and a bird coming and eating from it." "Tell us what it means. Interpret these dreams for us. Because we see that you seem to be a righteous man. You have the mark of a righteous man."
So Yusuf alayhis salaam responds and he tells them the meaning of that dream. As for one of you, you'll be saved from prison, you'll leave, and you'll become a close advisor to the king. And as for the other one, you will die. Yusuf alayhis salaam tells them, but he's also a key for goodness. Before he tells them the interpretation of this dream, he teaches them about Allah. He teaches them about Tawheed. He teaches them about the religion of Ibrahim and Ismail and Ishaq and Ya'qub alayhimus salaam, his forefathers. Being a key of goodness in every single aspect of your life.
The Prophet ﷺ as the Ultimate Key of Goodness
When you look at the life of our Prophet ﷺ, countless incidents, countless stories where the Prophet ﷺ would be approached or something would take place, and the Prophet ﷺ was a key for goodness.
Just a simple example: in the conquest of Mecca, when the Muslims came and they conquered the city of Mecca, the vast majority of those people who were living in Mecca during that time were non-Muslims. They were enemies to Islam. The likes of Abu Sufyan and his wife Hind, and Ikrimah the son of Abu Jahl, and many others who were trying to destroy Islam and kill the Prophet ﷺ. But now the Muslims had come and conquered Mecca.
From amongst those people who was in Mecca and was not yet a Muslim was the father of Abu Bakr رضي الله عنه, Abu Quhafa. An elderly man, blind from old age, his back bent over because of old age, his hair and his beard white because of old age. Abu Bakr رضي الله عنه went to his father Abu Quhafa, took him by his hand, and walked with him to the Prophet ﷺ. An elderly man.
When the Prophet ﷺ saw Abu Quhafa, the father of Abu Bakr, and he knows he's not a Muslim, he knows he hasn't accepted Islam, but he sees that the man is elderly, in need, feeble, frail. So the Prophet ﷺ said to Abu Bakr, "Why didn't you leave the Shaykh at home? The old man — leave him at home, I would have gone to him." And then the Prophet ﷺ took the hand of Abu Quhafa and he said, "Do you not testify that Allah alone is worthy of worship, and that I am the Messenger of Allah?" And Abu Quhafa took the shahada. He became a Muslim at this elderly age. But look at the way that the Prophet ﷺ is honoring him, saying, "I would have come to him; I had more right that I should go to him" — even though he was an elder, even though he was not yet a Muslim.
Correcting Harm in Worship: The Long Prayer
The Prophet ﷺ used to be a key of goodness, and he would instruct his companions at the same time to stay away from things which cause harm to others — things which cause distress to others. We have enough of our own sins and our own problems to worry about without accumulating the sins of others upon our shoulders, carrying the burdens of others upon our shoulders.
When the Prophet ﷺ would see distress being caused to the Muslims, even from amongst one of his companions — even in issues of ibadah, of worshipping Allah subhanahu wa ta'ala, where apparently it may seem that it is a good thing but because there is some difficulty, some harm being caused — the Prophet ﷺ would speak to his companions and advise them.
In the hadith of Uqba ibn Amr رضي الله عنه, he said that a man came to the Prophet ﷺ and said:
(Sahih al-Bukhari, Hadith 702; Sahih Muslim, Hadith 466)
"O Messenger of Allah, by Allah, I delay the Fajr prayer — I come right at the end — on purpose because of the imam so-and-so." Not in the Prophet's mosque, in another place. "Because he prolongs his prayer too much — he makes the prayer too long." And we know that the general rule in salah, when you're praying at home and praying alone, the longer your salah the better, the greater the reward in the sight of Allah subhanahu wa ta'ala. But when there are people behind you praying, when you have a congregation and you don't know each individual's situation, their issues and their problems and their appointments and what they have to do — مِمَّا يُطِيلُ بِنَا — "this imam makes our prayer long."
The narrator of the hadith said: مَا رَأَيْتُ رَسُولَ اللَّهِ ﷺ فِي مَوْعِظَةٍ أَشَدَّ غَضَبًا مِنْهُ يَوْمَئِذٍ — "I never saw the Prophet ﷺ more angry in a sermon of his than on that day." And he said to the people:
(Sahih al-Bukhari, Hadith 702; Sahih Muslim, Hadith 466)
"From amongst you there are people who turn others away from Allah. This man is the imam — he's leading them in prayer — he's prolonging the prayer. So if one of you wants to be the imam, let him make the prayer shorter. Because behind him there are the elderly and the sick and those people who have other things to do — they have jobs, they have appointments, they have things that they need to go and busy themselves with."
We have people and — inshallah — this is a masjid that is welcoming. But even in issues of ibadah, if you see someone in this masjid, whether in the men's hall or the women's hall, and they're a new person, a new face to you, and perhaps they're making a mistake, perhaps they're not dressed appropriately — there is a way to approach them and be a key of goodness. And there is a way to approach them and be a lock upon goodness. The Prophet ﷺ is instructing and teaching the companions: be careful in the way that you approach people.
The Bedouin Who Urinated in the Masjid
Didn't the Bedouin man come into the masjid of the Prophet ﷺ, go to the corner and begin to urinate? We know the hadith. The Prophet ﷺ calmed his companions because they became angry when they saw this. It's the masjid — the house of Allah — and not just any house of Allah, the masjid of our Prophet ﷺ in Medina. But the Prophet ﷺ calmed them down and he said, "Let him finish." And when he finished, he told them to find water and go and clean it. And he called the man and he said to him, "These are the houses of Allah. They are for salah, for prayer, and for Qur'an, and for the remembrance of Allah. And it is not befitting that you do what you just did in a place like this."
The man was so amazed by the character and the conduct of the Prophet ﷺ that he said, "Oh Allah, forgive me and forgive Muhammad. Have mercy upon me and upon Muhammad ﷺ." Because the Prophet ﷺ had taken a situation — even though people had told him off, perhaps they would have been within their rights, perhaps it's something that most people would have accepted — and not only stopped that evil, but transformed it into a means of goodness, teaching and educating the people.
Mu'adh ibn Jabal and the Long Recitation
In another hadith, collected in al-Nasa'i, it is reported that Mu'adh ibn Jabal رضي الله عنه — the great, illustrious companion of the Prophet ﷺ, one of the most noble and most knowledgeable companions that lived during that time — used to pray salah with the Prophet ﷺ in Masjid al-Nabawi. He would pray the Isha prayer in jama'ah, in congregation. And then he would leave and he would go to Quba', which in those days was on the outskirts of Medina, and he would go and be the imam for his own people. They wouldn't pray until Mu'adh came back. When Mu'adh would come — even though he had already prayed — he would pray as a nafl prayer as the imam, and they would pray the Isha behind him.
One night the Prophet ﷺ delayed the Isha prayer — because the custom and the norm was that the Prophet ﷺ would wait for the people to gather from their jobs and their work. So if they gathered earlier, he would pray early. And if they were slower, he would wait until they gathered and then he would pray. So one night the prayer was delayed. Mu'adh prayed in Medina and then he went to Quba' and he began to pray Isha and he started reciting Surah al-Baqarah — the longest surah of the Qur'an.
A man who was praying behind him left the salah, broke his salah, went to the corner of the masjid, prayed his Isha by himself, and went home. Someone met him after the salah and said, "Have you committed hypocrisy?" He said, "No, by Allah, I haven't committed hypocrisy. But I will go to the Prophet ﷺ and tell him what took place." So the next day he came to Medina and said, "O Messenger of Allah, Mu'adh — he prays Isha with you, and then when he comes back, especially when the Isha is delayed, he comes back and he prays with us as the imam and he recites Surah al-Baqarah. So I left the salah, prayed my own prayer and went home, because I'm a shepherd and a farmer. I wake up early in the morning. I have work to do."
So the Prophet ﷺ called Mu'adh and said, "O Mu'adh, do you wish to cause fitna for the people? Do you wish to cause people trials within their religion? Rather, O Mu'adh, when you lead, recite such and such a surah." And the Prophet ﷺ told him the types and lengths of surahs that he should recite. The Prophet ﷺ didn't say anything to that man who broke his prayer, didn't say anything to that man who left the salah and did his own thing and went home — because he had a valid reason. And the Prophet ﷺ is instructing Mu'adh that he needs to be aware of the situation of the people.
Be a key for goodness and a lock upon evil. That is what Allah azza wa jal has instructed us to be. That is what we find within the surahs and the stories of the Quran and within the life and the examples of our Prophet ﷺ.
May Allah make us all a key of good and a lock upon evil.
Second Khutbah: Wanting Good for Others
الحمد لله على إحسانه، وشكرُهُ على توفيقه وامتنانه، وأشهد أن لا إله إلا الله وحده لا شريك له تعظيمًا لشأنه، وأشهد أن نبيّنا وسيّدنا محمدًا عبده ورسوله الداعي إلى رضوانه، صلى الله عليه وعلى آله وصحبه وإخوانه وسلّم تسليمًا كثيرًا، أما بعد.
From amongst the components of this hadith and the meanings of these words of our Prophet ﷺ — being a key for goodness — is wanting good for others. When you advise someone, or when you see someone making a mistake and you speak to them, it should be with the intention that you want goodness for them, that you want khair for them, that you want benefit for them. The point of advising people, of speaking out when you see mistakes, of even just meeting with other people and interacting with them, is not to put them down or to disgrace them or to humiliate them — but rather it is to seek and want goodness for them, genuine goodness. That is your intention first and foremost.
Al-Imam al-Shafi'i rahimahullah ta'ala said that he never debated with another person except that he wanted Allah to bring the truth upon his brother's tongue — not upon his own tongue — upon his brother's tongue, because he wanted good for his brother just as he wanted good for himself.
Not Rejoicing When Other Muslims Are Attacked
From the components and the meanings of this hadith of the Prophet ﷺ is that when you see people — especially your fellow Muslims, your brothers and sisters — being attacked in any way, shape, and form, you should not be happy and you should not rejoice that they're being put down. We live in a time now when many people are attacking Islam. And the way that they attack Islam is that they attack certain groups — this group because of the way that they dress, this group because of the way that they act, that group because of the way that they do something. And even though we may have differences with people in terms of their beliefs and those are correct and valid issues, at the same time we don't rejoice when we see other Muslims being put down — because today it is them, and tomorrow it will be us.
Amongst the Arabs there is a famous story of the three bulls — a black bull, a white bull, and a red bull. A lion wanted to come but he couldn't eat all three bulls. So he went to two of those bulls and said, "I don't want you — I want the white bull. Leave me alone, let me take the white bull, and I'll leave you alone." They agreed. "Better he takes him than us." So the lion goes and kills and eats the white bull.
But after a few days he becomes hungry again. So this time he wants to take the other two bulls, the red and the black one. But again he can't take both of them down. So he goes to the black bull and says, "I don't want you, I want the red one. Leave me alone and I'll leave you alone." The black bull says, "Okay, better him than me." So he goes and eats the red bull. But the lion, being a lion, after a few days comes back and is hungry. And now it corners the black bull. It's alone, has no friends to help it, has no one to come to its aid. So when this bull sees this, it says: "I died the day that white bull died. The day that I gave up my principles, the day that I let you eat that white bull — that's the day that I sealed my own fate."
So we as Muslims need to understand: being a key of goodness means that you want good for the people. And when they make mistakes, there is a way and a manner in which to advise them, in which you bring them closer to goodness. Whenever you call someone out and disgrace them and humiliate them publicly — we will never accept this from anyone, so why would anyone else? There is hikmah in the way that the Prophet ﷺ used to correct people, the way that he used to speak to people, the way that he used to advise people.
The Testimony of the People: A Final Hadith
I want to leave you with a final hadith — a hadith narrated by Abu Hurairah رضي الله عنه — that the Prophet ﷺ was sitting with his companions and they saw a janazah, a funeral procession, go past them. So the people began to praise the deceased person, speak of them in terms of goodness. So the Prophet ﷺ said:
(Sahih al-Bukhari, Hadith 1367; Sahih Muslim, Hadith 949)
"It has been written, it has been written, it has been written." And then after a while another funeral procession, another janazah, passed by. But this time the people did not have glowing terms to speak of concerning that person. They didn't say anything good. So the Prophet ﷺ said again: وَجَبَتْ، وَجَبَتْ، وَجَبَتْ — "It has been written, it has been written, it has been written."
Umar رضي الله عنه said, "O Messenger of Allah, a janazah went past, the people praised it and you said it's been written. And then a janazah went past and the people didn't say anything good, and you said it's been written. What's been written?" The Prophet ﷺ said, "Your words — your testimony for those people — it has been written."
(Sahih al-Bukhari, Hadith 1367; Sahih Muslim, Hadith 949)
"The angels of Allah, they are the witnesses of Allah in the heavens. And you — meaning the people — you are the witnesses of Allah upon this earth."
When people speak of you in good terms because of the goodness that you bring to other people, that is — inshallah — a sign of goodness for you. But if the people don't have anything good to speak of about you, they don't have anything good to say about you, then that is something that should cause alarm bells to ring. It should make you stop and think about the way that you are.
Be a key of goodness, a lock upon evil, and seek refuge in Allah from being a key of evil and a lock upon goodness.
Du'a
We ask Allah azza wa jal that He showers His blessings upon us and our community, and that Allah azza wa jal keeps us firm upon the straight path, and that Allah protects us and our children and our families and our community from every type of trial, whether great or small, whether apparent or hidden.
We ask Allah azza wa jal that He showers His mercy and blessings upon us, that He forgives us for our sins, that He enters us into the highest ranks of Jannah. We ask Allah azza wa jal on this blessed day of Jumu'ah that He relieves the distress of our brothers and sisters across the world, and that Allah azza wa jal makes their affairs easy for them, that Allah cures those from amongst us that are ill, and that He forgives and has mercy upon those from amongst us that have passed away.