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:12:40

You worship not besides Him except ˹mere˺ names you have named them, you and your fathers, for which Allah has sent down no authority. Legislation is not but for Allah. He has commanded that you worship not except Him. That is the correct religion, but most of the people do not know.  

You do not worship, apart from Him, that is, other than Him, anything but ˹mere˺ names that you have named, that you have named for idols, you and your fathers. God has not revealed any warrant, any definitive argument or proof, regarding them, regarding worship of them. Judgement, decree, belongs only to God, alone. He has commanded that you worship none but Him. That, affirmation of ˹God’s˺ Oneness, is the upright, the straight, religion, but most people — and these are the disbelievers — do not know, the punishment in which they shall end up, and so they ascribe partners ˹to God˺.
القرآن:١٢:٤٠

مَا تَعْبُدُونَ مِنْ دُونِهِ إِلَّا أَسْمَاءً سَمَّيْتُمُوهَا أَنْتُمْ وَآبَاؤُكُمْ مَا أَنْزَلَ اللَّهُ بِهَا مِنْ سُلْطَانٍ ۚ إِنِ الْحُكْمُ إِلَّا لِلَّهِ ۚ أَمَرَ أَلَّا تَعْبُدُوا إِلَّا إِيَّاهُ ۚ ذَٰلِكَ الدِّينُ الْقَيِّمُ وَلَٰكِنَّ أَكْثَرَ النَّاسِ لَا يَعْلَمُونَ  

{ما تعبدون من دونه} أي غيره {إلا أسماء سميتموها} سميتم بها أصناما {أنتم وآباؤكم ما أنزل الله بها} بعادتها {من سلطان} حجة وبرهان {إن} ما {الحكم} القضاء {إلا لله} وحده {أمر ألا تعبدوا إلا إياه ذلك} التوحيد {الدين القيم} المستقيم {ولكنَّ أكثر الناس} وهم الكفار {لا يعلمون} ما يصيرون إليه من العذاب فيشركون.