Hadithcore
Mishkat al-Masabih, 110
graded· Zubair `Aliza'i

Matar b. ‘Ukamis reported God’s messenger as saying, “When God decrees that someone should die in a certain land, He gives him a reason for going there." Ahmad and Tirmidhi transmitted it.

وَعَن مطر بن عكام قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِذَا قَضَى اللَّهُ لِعَبْدٍ أَنْ يَمُوتَ بِأَرْضٍ جَعَلَ لَهُ إِلَيْهَا حَاجَةً» . رَوَاهُ أَحْمَدُ وَالتِّرْمِذِيّ

References1 variant
In-Book Reference
Book 1, Hadith 103