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:34:41

They will say, "Exalted are You! You, ˹O Allah˺, are our benefactor not them. Rather, they used to worship the jinn; most of them were believers in them."  

They will say, ‘Glory be to You, exalted above that You should have an associate! You are our Supporter, not they, in other words, as far as we are concerned there are no bonds of association between us and them. Nay, (bal, is to indicate transition) rather, they used to worship the jinn, the devils, in other words, ˹they used to˺ obey them and ˹agree to˺ worship us; most of them were believers in them’, accepting as truth what these ˹jinn˺ used to say to them.
القرآن:٣٤:٤١

قَالُوا سُبْحَانَكَ أَنْتَ وَلِيُّنَا مِنْ دُونِهِمْ ۖ بَلْ كَانُوا يَعْبُدُونَ الْجِنَّ ۖ أَكْثَرُهُمْ بِهِمْ مُؤْمِنُونَ  

{قالوا سبحانك} تنزيها لك عن الشريك {أنت ولينا من دونهم} أي لا موالاة بيننا وبينهم من جهتنا {بل} للانتقال {كانوا يعبدون الجن} الشياطين، أي يطيعونهم في عبادتهم إيانا {أكثرهم بهم مؤمنون} مصدقون فيما يقولون لهم.