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:65

And it was already revealed to you and to those before you that if you should associate ˹anything˺ with Allah, your work would surely become worthless, and you would surely be among the losers."  

And certainly it has been revealed to you and to those before you ˹that˺, by God!, if you associate others ˹with God˺, O Muhammad (s) — hypothetically — your work shall surely fail and you shall surely be among the losers’.
القرآن:٣٩:٦٥

وَلَقَدْ أُوحِيَ إِلَيْكَ وَإِلَى الَّذِينَ مِنْ قَبْلِكَ لَئِنْ أَشْرَكْتَ لَيَحْبَطَنَّ عَمَلُكَ وَلَتَكُونَنَّ مِنَ الْخَاسِرِينَ  

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