Riyad as-SalihinChapter 4Hadith 157
Full Sharh — Riyad as-Salihin 157
وعنه عن رسول الله صلى الله عليه وسلم قال: "من قعد مقعداً لم يذكر الله تعالى فيه كانت عليه من الله ترة، ومن اضطجع مضجعاً لم يذكر الله فيه كانت عليه من الله ترة" ((رَوَاهُ أبُو دَاوُدَ)). وقد سبق قريباً، وشرحنا "الترة" فيه.
English Translation
Abu Hurairah (May Allah be pleased with him) reported:: Messenger of Allah (ﷺ) said, "If anyone sits in a gathering where he does not remember Allah, he will bring grief upon himself (on the Day of Resurrection), and he who lies down in a place where he does not remember Allah, will bring grief upon himself (on the Day of Resurrection).".
Source
Riyad as-Salihin(رياض الصالحين)
The Book of the Etiquette of Sleeping, Lying and Sitting etc
Hadith Number
157