Allah, the Exalted, said:
٩٦ - باب وداع الصاحب ووصيته عند فراقه للسفر وغيره والدعاء له وطلب الدعاء منه
Allah, the Exalted, said:
And Abraham instructed his sons [to do the same] and [so did] Jacob, [saying], "O my sons, indeed Allāh has chosen for you this religion, so do not die except while you are Muslims."
As for the hadiths, among them is the following:
The hadith of Zayd ibn Arqam (may Allah be pleased with him), which came earlier in the chapter on honouring the household of the Messenger of Allah (peace and blessings be upon him): He said: The Messenger of Allah (peace and blessings be upon him) stood among us to deliver an address. He praised Allah and extolled Him, and admonished and reminded, then said: "To proceed: O people, I am only a human being, and soon the messenger of my Lord will come and I shall answer. I am leaving among you two weighty things: the first of them is the Book of Allah, in which is guidance and light, so take hold of the Book of Allah and cling fast to it." So he urged adherence to the Book of Allah and encouraged people towards it. Then he said: "And the people of my household: I remind you of Allah regarding the people of my household." Muslim narrated it, and it has already come in full.
On the authority of Abu Sulayman Malik ibn al-Huwayrith (may Allah be pleased with him), who said: We came to the Messenger of Allah (peace and blessings be upon him) while we were young men close in age, and we stayed with him for twenty nights. The Messenger of Allah (peace and blessings be upon him) was merciful and gentle, and he supposed that we had grown homesick for our families. So he asked us about those we had left behind from our families, and we informed him. He said: "Return to your families, stay among them, teach them and instruct them. Pray such-and-such a prayer at such-and-such a time, and pray such-and-such at such-and-such a time; and when the prayer is due, let one of you give the call to prayer for you, and let the eldest of you lead you." Agreed upon. Al-Bukhari added in a narration of his: "And pray as you have seen me pray." His words "merciful and gentle" (raḥīman rafīqan) were narrated with an f and a q, and were also narrated with two q's.
On the authority of Umar ibn al-Khattab (may Allah be pleased with him), who said: I sought the permission of the Prophet (peace and blessings be upon him) to perform the lesser pilgrimage, and he gave permission and said: "Do not forget us, my dear brother, in your supplication." He spoke a word with which I would not be pleased to have the whole world in its place. In another narration he said: "Include us, my dear brother, in your supplication." Abu Dawud and al-Tirmidhi narrated it, and he said: "A good and sound hadith."
On the authority of Salim ibn Abdullah ibn Umar: that Abdullah ibn Umar (may Allah be pleased with them both) used to say to a man when he intended to travel: "Come close to me so that I may bid you farewell, just as the Messenger of Allah (peace and blessings be upon him) used to bid us farewell." Then he would say: "I entrust to Allah your religion, your trust, and the final outcomes of your deeds." Al-Tirmidhi narrated it, and he said: "A good and sound hadith."
On the authority of Abdullah ibn Yazid al-Khatmi, the Companion (may Allah be pleased with him), who said: When the Messenger of Allah (peace and blessings be upon him) wished to bid farewell to an army, he would say: "I entrust to Allah your religion, your trust, and the final outcomes of your deeds." A sound hadith, narrated by Abu Dawud and others with a sound chain of transmission.
On the authority of Anas (may Allah be pleased with him), who said: A man came to the Prophet (peace and blessings be upon him) and said: "O Messenger of Allah, I intend to travel, so provide me with provision." He said: "May Allah provide you with God-consciousness (taqwā)." The man said: "Give me more." He said: "And may He forgive your sin." He said: "Give me more." He said: "And may He make good easy for you wherever you may be." Al-Tirmidhi narrated it, and he said: "A good hadith."