Sahih al-Bukhari 6731
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
أَنَا أَوْلَى، بِالْمُؤْمِنِينَ مِنْ أَنْفُسِهِمْ، فَمَنْ مَاتَ وَعَلَيْهِ دَيْنٌ، وَلَمْ يَتْرُكْ وَفَاءً، فَعَلَيْنَا قَضَاؤُهُ، وَمَنْ تَرَكَ مَالاً فَلِوَرَثَتِهِ "
Narrated Abu Huraira:
The Prophet (ﷺ) said, "I am more closer to the believers than their own selves, so whoever (of them) dies while being in debt and leaves nothing for its repayment, then we are to pay his debts on his behalf and whoever (among the believers) dies leaving some property, then that property is for his heirs."
Full reference and source
Sahih al-Bukhari 6731 In-book : Book 85, Hadith 8 USC-MSA web (English) : Vol. 8, Book 80, Hadith 723 (deprecated)
View source on Sunnah.com (opens in a new tab)