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:39:3

Unquestionably, for Allah is the pure religion. And those who take protectors besides Him ˹say˺, "We only worship them that they may bring us nearer to Allah in position." Indeed, Allah will judge between them concerning that over which they differ. Indeed, Allah does not guide he who is a liar and ˹confirmed˺ disbeliever.  

Surely to God belongs pure religion, none other than Him being deserving of it. And those who take besides Him, the idols ˹as˺, patrons: and they are the disbelievers of Mecca — they say: ‘We only worship them so that they may bring us near to God’ (zulfā, a verbal noun, with the sense of taqrīban, ‘for the sake of nearness’). God will indeed judge between them, and the Muslims, concerning that about which they differ, of religion, and so admit the believers into Paradise, and the disbelievers into the Fire. Truly God does not guide one who is a liar, attributing a child to Him, a disbeliever, worshipping other than God.
القرآن:٣٩:٣

أَلَا لِلَّهِ الدِّينُ الْخَالِصُ ۚ وَالَّذِينَ اتَّخَذُوا مِنْ دُونِهِ أَوْلِيَاءَ مَا نَعْبُدُهُمْ إِلَّا لِيُقَرِّبُونَا إِلَى اللَّهِ زُلْفَىٰ إِنَّ اللَّهَ يَحْكُمُ بَيْنَهُمْ فِي مَا هُمْ فِيهِ يَخْتَلِفُونَ ۗ إِنَّ اللَّهَ لَا يَهْدِي مَنْ هُوَ كَاذِبٌ كَفَّارٌ  

{ألا الله الدين الخالص} لا يستحقه غيره {والذين اتخذوا من دونه} الأصنام {أولياء} وهم كفار مكة قالوا {ما نعبدهم إلا ليقربونا إلى الله زلفى} قربى مصدر بمعنى تقريبا {إن الله يحكم بينهم} وبين المسلمين {في ما هم فيه يختلفون} من أمر الدين فيدخل المؤمنين الجنة، والكافرين النار {إن الله لا يهدي من هو كاذب} في نسبة الولد إليه {كفار} بعبادته غيره الله.