The Messenger of Allah ﷺ saw some phlegm on the qiblah wall of the mosque and scraped it off. He then said, "When any of you is praying, he should not spit out phlegm, for Allah the Exalted is before the face of each of you during the prayer."
حدثنا يحيى عن عبيد الله أخبرنا نافع
أن رسول الله ﷺ رأى نخامة في قبلة المسجد فحتها ثم قال إذا كان أحدكم في الصلاة فلا يتنخم فإن الله تعالى قبل وجه أحدكم في الصلاة