There is a scene in the Qur'an that should stop you in your tracks if you have ever picked a friend without really thinking about it. Picture a man standing before Allah on the Day of Judgment. He is not being interrogated for some hidden crime. He is just standing there, and out of pure regret, he starts biting down on his own hands. Not because he has lost his mind, but because the regret is so overwhelming that his body does not know what else to do with it. And in that moment, this is what comes out of his mouth.
وَيَوْمَ يَعَضُّ الظَّالِمُ عَلَىٰ يَدَيْهِ يَقُولُ يَا لَيْتَنِي اتَّخَذْتُ مَعَ الرَّسُولِ سَبِيلًا۔ يَا وَيْلَتَىٰ لَيْتَنِي لَمْ أَتَّخِذْ فُلَانًا خَلِيلًا۔ لَّقَدْ أَضَلَّنِي عَنِ الذِّكْرِ بَعْدَ إِذْ جَاءَنِي
"And the Day the wrongdoer will bite on his hands, he will say, 'Oh, I wish I had taken a path with the Messenger. Oh, woe to me! I wish I had not taken so and so as a close friend. He led me astray from the remembrance after it had come to me.'" (Surah Al Furqan, 25:27 to 29)
Sit with that for a second. This is not someone being punished for something he did alone. In his own final words, he points to one relationship. One friend he chose, trusted, spent his time with, and let shape him, until that friendship pulled him further from Allah than he ever meant to go. Allah did not have to include this scene in the Qur'an. He chose to. And that choice alone tells you something. Friendship is never just a small, casual part of life in Islam. It is one of the very few things the Qur'an shows a person regretting out loud, in plain words, on the one day when regret changes nothing.
The question underneath the question
Ask any young Muslim honestly whether their friends affect their deen, and most will admit that yes, of course they do. But there's a harder question sitting just underneath that one. It's the question people actually type into their phones at midnight, half hoping no one ever sees it. Do I have to give up my friends to become a better Muslim? Is it wrong that I still love people who do not pray, who do not cover, who honestly do not seem to care? Does pulling away from them make me judgmental?
That is the real tension. Nobody wants to become that person who drops people the moment they are not perfect, because let's be honest, no one is. Even the companions of the Prophet ﷺ were not perfect. And yet there is this quiet feeling that won't go away, this sense that not every friendship is equally safe for your heart. That feeling deserves a real answer, not the easy excuse that friends do not really change you, and not the harsh instinct to cut off anyone who is not visibly religious either.
Islam's answer lands right in between those two extremes, and it's a lot more precise than either one.
Friendship: not just company but absorption
The Prophet ﷺ didn't leave this as some vague spiritual idea. He said it plainly, almost like a warning you would want to write down.
الرَّجُلُ عَلَىٰ دِينِ خَلِيلِهِ فَلْيَنْظُرْ أَحَدُكُمْ مَنْ يُخَالِلُ
"A man follows the religion of his close friend, so let each of you look closely at whom he befriends." (Sunan Abu Dawud 4833, Sunan al Tirmidhi 2378, graded hasan)
Notice what word he used. Not "influence." Deen. Religion itself. He was not warning that your friends might change your music taste or your sense of humor. He was warning that they shape the actual lens you see right and wrong through, what feels normal to you and what doesn't. And here's the part that makes it so easy to miss happening. You don't sit down one day and decide to adopt your friend group's standards. You just absorb them, slowly, the way your clothes pick up a smell just from hanging in the same closet. One day you notice their casualness toward something has quietly become your own, and you can't even point to the moment it happened.
The Prophet ﷺ actually gave us a picture for this, and it might be one of the clearest ones in the entire hadith tradition.
مَثَلُ الْجَلِيسِ الصَّالِحِ وَالسَّوْءِ كَحَامِلِ الْمِسْكِ وَنَافِخِ الْكِيرِ
"The likeness of a righteous companion and an evil one is that of a carrier of musk and a blower of a blacksmith's bellows. As for the carrier of musk, either he will give you some, or you will buy some from him, or you will find a pleasant smell from him. As for the one who blows the bellows, either he will burn your clothes, or you will find a foul smell from him." (Sahih al Bukhari 5534, Sahih Muslim 2628)
Think about how honest this comparison is. You don't have to try to smell like the musk seller. Just standing near him for a while is enough to carry something good away with you. And you do not have to try to get burned by the blacksmith's fire either. Just staying close long enough guarantees the smoke clings to you, whether he meant to burn you or not. The Prophet ﷺ is not talking about intention here. He's talking about exposure. Your friend does not need to be actively trying to pull you down for it to happen. Time and closeness do that work quietly, on their own, the same way they quietly build you up when the company is good.
This is exactly why Surah Az Zukhruf draws such a sharp, almost frightening line around the Day of Judgment.
الْأَخِلَّاءُ يَوْمَئِذٍ بَعْضُهُمْ لِبَعْضٍ عَدُوٌّ إِلَّا الْمُتَّقِينَ
"Close friends, that Day, will be enemies to one another, except for the righteous." (Surah Az Zukhruf, 43:67)
Any friendship built on something other than taqwa, whether that's shared ambition, shared jokes, shared habits, or just shared status, is temporary in the fullest sense of the word. It would not just fade quietly with time. According to the Qur'an, it will actually flip into enmity, because whatever it was standing on simply won't exist anymore once this life ends. The only friendship that survives into the next life is one rooted in love for Allah. That is actually why the Prophet ﷺ, when describing the seven people Allah will shelter under His shade on a day with no other shade, specifically named two people whose love for each other existed only for His sake.
What this actually means for you, without turning into someone you are not
None of this means you need to start auditing every relationship in your life and cutting people off. Islam never asked anyone to withdraw from the world or treat every imperfect person like a threat. The Prophet ﷺ himself sat with people who didn't believe, shared meals with people who sinned openly, and showed more patience to the harshest men in Quraysh than most people manage to show their own siblings today. What this really comes down to is simpler than it sounds. Know the difference between company and closeness. You can still be kind, generous, and present for people whose choices you don't share, without letting them become your khalil, the inner circle whose opinions quietly start deciding how you see your own life. The danger was never about being around imperfect people. It's about being around them without ever stopping to notice what it's doing to you.
So here's a simple way to check yourself, and you can do it today. Think of the two or three people whose opinion actually moves something in you. The ones whose disappointment you'd feel in your chest, whose approval you find yourself chasing, whose habits you've picked up without even noticing. Now ask yourself honestly. After spending time with them, do you walk away carrying a bit of that musk, or do you walk away smelling like smoke? Do they remind you of Allah when you've forgotten Him, or do they make forgetting Him feel completely normal? Ask yourself that question honestly every few months, and it will tell you more than any dramatic decision to cut someone off ever could. Because the Qur'an was never really warning you about who sits next to you. It was warning you about who you let yourself slowly become.
The man in Surah Al Furqan bit his own hands because his choice had already been made, and the only place left to undo it was in his memory. You're still standing on the other side of that scene. The choice hasn't been made yet. That's really the only difference between his story and yours.