From the Quran
وَيَوۡمَ يَعَضُّ ٱلظَّالِمُ عَلَىٰ يَدَيۡهِ يَقُولُ يَٰلَيۡتَنِي ٱتَّخَذۡتُ مَعَ ٱلرَّسُولِ سَبِيلٗا
And the Day the wrongdoer will bite on his hands [in regret] he will say, “Oh, I wish I had taken with the Messenger a way.
يَٰوَيۡلَتَىٰ لَيۡتَنِي لَمۡ أَتَّخِذۡ فُلَانًا خَلِيلٗا
Oh, woe to me! I wish I had not taken that one as a friend.لَّقَدۡ أَضَلَّنِي عَنِ ٱلذِّكۡرِ بَعۡدَ إِذۡ جَآءَنِيۗ وَكَانَ ٱلشَّيۡطَٰنُ لِلۡإِنسَٰنِ خَذُولٗا
He led me away from the remembrance after it had come to me. And ever is Satan, to man, a deserter.”–Surah Al-Furqan, Ayah 27 – 29
Hadith: Arabic Text followed by English Translation.
عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم
الرَّجُلُ عَلَى دِينِ خَلِيلِهِ فَلْيَنْظُرْ أَحَدُكُمْ مَنْ يُخَالِلُ ”
قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ. و حسنه الألباني في صحيح الترمذي
Abu Hurairah narrated that the Messenger of Allah(ﷺ) said:
“A man is upon the religion of his friend, so let one of you look at whom he befriends.”
Jami` at-Tirmidhi 2378. At-Tirmidhi said, “This hadith is Hasan Gharib”. Classed as Hasan by Albani in Saheeh Tirmidhi.