Anas reported: A young Jewish boy used to serve the Prophet, peace and blessings be upon him, and he became sick, so the Prophet went to visit him. The Prophet sat near his head and asked him to accept Islam. The boy looked at his father, who was sitting next to him, and he told him, “Obey Abu al-Qasim,” and so the boy embraced Islam. The Prophet came out saying, “All praise is due to Allah, who has saved him from the Hellfire.”
Source: Ṣaḥīḥ al-Bukhārī 1356
Grade: Sahih (authentic) according to Al-Bukhari
Shaykh al-Islam Ibn Taymiyyah commented, “As for visiting a sick unbeliever, there is nothing wrong with doing so because that contains the benefit of bringing them closer to Islam.”
Source: Majmū’ al-Fatāwá 24/26
عَنْ أَنَسٍ قَالَ كَانَ غُلَامٌ يَهُودِيٌّ يَخْدُمُ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَمَرِضَ فَأَتَاهُ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَعُودُهُ فَقَعَدَ عِنْدَ رَأْسِهِ فَقَالَ لَهُ أَسْلِمْ فَنَظَرَ إِلَى أَبِيهِ وَهُوَ عِنْدَهُ فَقَالَ لَهُ أَطِعْ أَبَا الْقَاسِمِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَأَسْلَمَ فَخَرَجَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَهُوَ يَقُولُ الْحَمْدُ لِلَّهِ الَّذِي أَنْقَذَهُ مِنْ النَّارِ
1356 صحيح البخاري كتاب الجنائز باب إذا أسلم الصبي فمات هل يصلى عليه وهل يعرض على الصبي الإسلام
قال ابن تيمية وَأَمَّا عِيَادَتُهُ يعني كَافِرًا فَلَا بَأْسَ بِهَا فَإِنَّهُ قَدْ يَكُونُ فِي ذَلِكَ مَصْلَحَةٌ لِتَأْلِيفِهِ عَلَى الْإِسْلَامِ
24/265 مجموع الفتاوى كتاب الجنائز