Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:7:30

A group ˹of you˺ He guided, and a group deserved ˹to be in˺ error. Indeed, they had taken the devils as allies instead of Allah while they thought that they were guided.  

A party, of you, He has guided, while another party has deserved to go astray — they have taken devils as patrons instead of God, that is, other than Him, and think that they are guided’.
القرآن:٧:٣٠

فَرِيقًا هَدَىٰ وَفَرِيقًا حَقَّ عَلَيْهِمُ الضَّلَالَةُ ۗ إِنَّهُمُ اتَّخَذُوا الشَّيَاطِينَ أَوْلِيَاءَ مِنْ دُونِ اللَّهِ وَيَحْسَبُونَ أَنَّهُمْ مُهْتَدُونَ  

{فريقا} منكم {هدى وفريقا حق عليهم الضلالة إنهم اتخذوا الشياطين أولياء من دون الله} أي غيره {ويحسبون أنهم مهتدون}.