The Messenger of Allah ﷺ led the prayer one day, then turned to the people and said, "So-and-so, will you not perfect your prayer? Should the one praying not consider how he prays for his own sake? Indeed, I see behind me just as I see in front of me."
أخبرنا محمد بن عبد الله بن المبارك قال حدثني أبو أسامة قال حدثني الوليد بن كثير عن سعيد بن أبي سعيد عن أبيه
صلى رسول الله ﷺ يوما ثم انصرف فقال يا فلان ألا تحسن صلاتك ألا ينظر المصلي كيف يصلي لنفسه إني أبصر من ورائي كما أبصر بين يدي
Sahih Muslim collected it in the Book of Prayer, chapter on the command to perfect and complete the prayer and to maintain humility in it, hadith no. 423, from the hadith of Abu Usama with this chain, and it is also in Sunan al-Kubra, hadith no. 944.