Abu Qatada reported,

The Prophet ﷺ said, "When one of you comes to the masjid, let him pray two units of prayer before he sits down." Another version adds, "Then, if he wishes, let him sit afterwards, or go and attend to whatever he needs."

Abu Dawud 468

Sahih

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

أبو داود 468صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Prayer
Chapter
Prayer upon entering the masjid
Numbering
Darussalam 468
Abu Dawud 468