Shaykh Ibn Uthaymeen was asked:
The listener [to the Noor ‘ala Darb radio program] says: I have a friend who pushes me to evil. He is my friend for seven years. So what should I do with him?
“It is obligatory upon you to advise this friend who calls you to evil. If he is guided, then it is for himself and if he is not guided, then it is upon you to separate from him. This is because the Prophet (ﷺ) warned from accompanying the evil people.
He (ﷺ) said:
مثل الجليس الصالح كحامل المسك إما أن يحذيك وإما أن يبيعك وإما أن تجد منه رائحة طيبة ومثل الجليس السوء كنافخ الكير إما أن يحرق ثيابك وإما أن تجد منه رائحة كريهة
The example of a good companion is like that of the musk seller. Either he will give you some musk as a gift or sell it to you or you will find a good smell from him. The example of the bad friend is like the one who blows the bellows. Either he will burn your clothes or you will find a bad smell from him.
[Bukhari and Muslim]
This includes a warning from evil companions.
It was also reported from the Prophet (ﷺ) that he said:
المرء على دين خليله فلينظر أحدكم من يخالل
A man follows the religion of his friend; so each one should consider whom he makes his friend
[Saheeh Sunan Abi Dawood (no. 4833)]
Many people are upon firmness and adhering to the religion. Then when a devil from the devils of mankind is appointed for him, from those who misguide from the straight path, perhaps he will be affected by it. And the infallible one is the one whom Allah protects/preserves [from error]”.
[Noor ‘ala Darb (no. 436)]
Faisal Ibn Abdul Qaadir Ibn Hassan