Abu Hurairah reported,

The Messenger of Allah ﷺ said, "When one of you stands to pray, Satan comes to him and confuses him until he no longer knows how many units he has prayed. When any of you experiences this, let him perform two prostrations while seated."

Muslim 1265

Sahih

حدثنا يحيى بن يحيى قال قرأت على مالك عن ابن شهاب عن أبي سلمة بن عبد الرحمن

عن أبي هريرة

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

مسلم 1265صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Forgetfulness in prayer and sujud for it
Numbering
Darussalam 1265
Muslim 1265