The Messenger of Allah ﷺ used to say, "I am closer to the believers than they are to themselves. Whoever leaves behind wealth, it goes to his family, and whoever leaves behind a debt or dependents in need, their care falls upon me and is my responsibility."
حدثنا محمد بن كثير أخبرنا سفيان عن جعفر عن أبيه
كان رسول الله ﷺ يقول أنا أولى بالمؤمنين من أنفسهم من ترك مالا فلأهله ومن ترك دينا أو ضياعا فإلي وعلي
[Sahih] Ibn Majah reported it in the Book of Charities, Chapter: Whoever Leaves Behind a Debt or Dependents, It Falls upon Allah and His Messenger, no. 2416, from the hadith of Sufyan Thawri, through this same chain. Muslim also narrated it from the hadith of Jafar Sadiq, through this same chain, see no. 3343.