إِذَا قَضَى اللَّهُ لِعَبْدٍ أَنْ يَمُوتَ بِأَرْضٍ جَعَلَ لَهُ إِلَيْهَا حَاجَةً
Translation: When Allah decrees that a servant will die in a certain land, He brings about a need that takes that person there.
Source: الترمذي
قَضَى اللَّهُ means “Allah decreed,” لِعَبْدٍ “for a servant,” and بِأَرْضٍ “in a land.” جَعَلَ لَهُ إِلَيْهَا حَاجَةً describes a need arising that leads the person to that place.
Allah’s knowledge and decree encompass where and when a person dies, even though a traveler does not know that future. This does not justify recklessness or abandoning duties. A person still takes sensible precautions and fulfills religious and human responsibilities.