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:28:56

Indeed, ˹O Muhammad˺, you do not guide whom you like, but Allah guides whom He wills. And He is most knowing of the ˹rightly˺ guided.  

The following was revealed regarding the Prophet’s longing for his uncle Abū Tālib to embrace faith: You cannot guide whom you like, to be guided, but ˹it is˺ God ˹Who˺ guides whomever He will, and He knows best those who will be guided.
القرآن:٢٨:٥٦

إِنَّكَ لَا تَهْدِي مَنْ أَحْبَبْتَ وَلَٰكِنَّ اللَّهَ يَهْدِي مَنْ يَشَاءُ ۚ وَهُوَ أَعْلَمُ بِالْمُهْتَدِينَ  

ونزل في حرصه ﷺ على إيمان عمه أبي طالب {إنك لا تهدي من أحببت} هدايته {ولكن الله يهدي من يشاء وهو أعلم} عالم {بالمهتدين}.