Abu Musa Ashari reported,

We prayed Maghrib with the Messenger of Allah ﷺ, then we said to one another, "Why don't we stay seated until we pray Isha with him as well?" So we remained.He came out to us and said, "Are you still here?"We replied, "Messenger of Allah, we prayed Maghrib with you, then we decided to wait until we could pray Isha with you too."He said, "You have done well," or "You have done right."Then he raised his head toward the sky, as he often did, and said, "The stars are a source of security for the sky. When the stars disappear, what has been promised to the sky will come to pass. I am a source of security for my companions. When I am gone, what has been promised to my companions will come to pass. And my companions are a source of security for my ummah. When my companions are gone, what has been promised to my ummah will come to pass."

Muslim 6466

Sahih

حدثنا أبو بكر بن أبي شيبة وإسحق بن إبراهيم وعبد الله بن عمر بن أبان كلهم عن حسين قال أبو بكر حدثنا حسين بن علي الجعفي عن مجمع بن يحيى عن سعيد بن أبي بردة

عن أبي بردة عن أبيه قال

صلينا المغرب مع رسول الله ﷺ ثم قلنا لو جلسنا حتى نصلي معه العشاء قال فجلسنا فخرج علينا فقال ما زلتم هاهنا قلنا يا رسول الله صلينا معك المغرب ثم قلنا نجلس حتى نصلي معك العشاء قال أحسنتم أو أصبتم قال فرفع رأسه إلى السماء وكان كثيرا مما يرفع رأسه إلى السماء فقال النجوم أمنة للسماء فإذا ذهبت النجوم أتى السماء ما توعد وأنا أمنة لأصحابي فإذا ذهبت أتى أصحابي ما يوعدون وأصحابي أمنة لأمتي فإذا ذهب أصحابي أتى أمتي ما يوعدون

مسلم 6466صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Virtues of the Companions, may Allah be pleased with them
Chapter
Clarification that the Prophet ﷺ remaining is a source of safety for his Companions and his Companions remaining is a source of safety
Numbering
Darussalam 6466
Muslim 6466