The Prophet ﷺ could not sleep one night, so he said, "If only a righteous man from among my companions would guard me tonight." Just then we heard the sound of weapons.He asked, "Who is this?"Saad replied, "Messenger of Allah, I have come to guard you."The Prophet ﷺ then slept until we heard him snoring.
أرق النبي ﷺ ذات ليلة، فقال: ليت رجلا صالحا من أصحابي يحرسني الليلة، إذ سمعنا صوت السلاح. قال: من هذا؟ قال سعد: يا رسول الله، جئت أحرسك. فنام النبي ﷺ حتى سمعنا غطيطه.
Bukhari narrated it in Book of Wishing (7231), and Muslim in Merits of the Companions (2410-39), both through the route of Sulayman bin Bilal, who said, Yahya bin Saeed narrated to me, I heard Abdullah bin Amir bin Rabia say, Ayesha said, and he mentioned it.In another wording, "The Messenger of Allah ﷺ stayed awake one night after arriving in Madinah," and in it, "While we were like that, we heard the rustling of weapons. He said, 'Who is this?' Saad bin Abu Waqqas said, [it is I]. The Messenger of Allah ﷺ said to him, 'What brought you here?' He said, 'I felt a fear for the Messenger of Allah ﷺ in my heart, so I came to guard him.' The Messenger of Allah ﷺ then prayed for him, and then went to sleep."Muslim narrated it (2410-40) through another route from Yahya bin Saeed, with the same wording.