The Messenger of Allah ﷺ said, "No people sit in a gathering without remembering Allah in it except that it will be a source of regret for them. No man walks along a path without remembering Allah except that it will be a source of regret for him. And no man retires to his bed without remembering Allah except that it will be a source of regret for him."Ubayy said, Rawh narrated this to us, saying, Ibn Abu Dhib narrated to us from al-Maqburi from Ishaq, the freed slave of Abdullah bin Harith, but he did not mention "when he retires to his bed."
حدثنا يحيى عن ابن أبي ذئب قال حدثنا سعيد بن أبي سعيد عن إسحاق
قال رسول الله ﷺ ما جلس قوم مجلسا فلم يذكروا الله فيه إلا كان عليهم ترة وما من رجل مشى طريقا فلم يذكر الله عز وجل إلا كان عليه ترة وما من رجل أوى إلى فراشه فلم يذكر الله إلا كان عليه ترة قال أبي حدثناه روح قال حدثنا ابن أبي ذئب عن المقبري عن إسحاق مولى عبد الله بن الحارث ولم يقل إذا أوى إلى فراشه
Its isnad is sahih. Tirmidhi narrated it, 5/361 no. 3380, and Ibn Hibban, 577 no. 2321, and Abu Dawud narrated its last part in the Book of Manners, in the chapter on the dislike of a man rising from his sitting place, 4/264 no. 4856, and in the chapter on what is said upon sleeping, 4/314 no. 5059.