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."
حدثنا مسدد حدثنا عبد الواحد بن زياد حدثنا أبو عميس عتبة بن عبد الله عن عامر بن عبد الله بن الزبير عن رجل من بني زريق عن أبي قتادة عن النبي ﷺ بنحوه زاد ثم ليقعد بعد إن شاء أو ليذهب لحاجته