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:42:6

And those who take as allies other than Him - Allah is ˹yet˺ Guardian over them; and you, ˹O Muhammad˺, are not over them a manager.  

And those who have taken besides Him, namely, idols ˹as˺, guardians, God is watchful over them, He keeps count ˹of their deeds˺, that He may requite them; and you are not a guardian over them, in order to secure what is demanded of them: your duty is only to deliver the Message.
القرآن:٤٢:٦

وَالَّذِينَ اتَّخَذُوا مِنْ دُونِهِ أَوْلِيَاءَ اللَّهُ حَفِيظٌ عَلَيْهِمْ وَمَا أَنْتَ عَلَيْهِمْ بِوَكِيلٍ  

{والذين اتخذوا من دونه} أي الأصنام {أولياء الله حفيظ} محص {عليهم} ليجازيهم {وما أنت عليهم بوكيل} تحصل المطلوب منهم، ما عليك إلا البلاغ.