From Sahih Bukhari (Hadith 6763):
Narrated Abu Huraira:The Prophet (ﷺ) said, " If somebody dies (among the Muslims) leaving some property, the property will go to his heirs; and if he leaves a debt or dependants, we will take care of them
Reference: Bukhari 6763