Mishkat al-Masabih
Mishkat al-Masabih 110
Arabic hadith text
وَعَن مطر بن عكام قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِذَا قَضَى اللَّهُ لِعَبْدٍ أَنْ يَمُوتَ بِأَرْضٍ جَعَلَ لَهُ إِلَيْهَا حَاجَةً» . رَوَاهُ أَحْمَدُ وَالتِّرْمِذِيّ
Translation
Maṭar ibn ʿUkkām reported that the Messenger of God said, ‘When God decrees that a servant is to die in a land, He creates for him a need that takes him there.’ Aḥmad and al-Tirmidhi transmitted it.