The Messenger of Allah ﷺ said, "When Allah decrees that a servant should die in a particular land, He creates for him a need that takes him there," or he said, "a need in that land."
قال رسول الله ﷺ: إذا قضى الله لعبد أن يموت بأرض جعل له إليها حاجة، أو قال: بها حاجة.
Related by Tirmidhi (2147), Ahmad (15539), and Bukhari in Adab al-Mufrad (780). Ibn Hibban (6151) and Hakim (1/42) graded it sahih. All of them narrated it from the hadith of Ismail bin Ibrahim (Ibn Ulaya), from Ayub, from Abu Malih bin Usama, from Abu Uzza, who mentioned it. Its chain of transmission is sahih.