The Messenger of Allah ﷺ used to remember Allah at all times.
حدثنا سويد بن سعيد حدثنا يحيى بن زكريا بن أبي زائدة عن أبيه عن خالد بن سلمة عن عبد الله البهي عن عروة
أن رسول الله ﷺ كان يذكر الله عز وجل على كل أحيانه
Muslim narrated it in the Book of Menstruation, chapter on remembering Allah while in a state of janaba or otherwise, hadith no. 373, via the route of Ibn Abu Zaida with this wording. Bukhari mentioned it without a full chain in the Book of Adhan, chapter on whether the caller to prayer should move his mouth... etc., before hadith no. 634.