The Messenger of Allah ﷺ said, "When one of you enters the mosque, let him pray two cycles before sitting down."
حدثنا عبد الرحمن بن مهدي حدثنا مالك يعني ابن أنس عن عامر بن عبد الله يعني ابن الزبير عن عمرو بن سليم
قال رسول الله ﷺ إذا دخل أحدكم المسجد فليركع ركعتين قبل أن يجلس
Its isnad is sahih, its narrators are trustworthy and well known, and the hadith is in the Sahihayn. Bukhari related it in 1/537 no. 444 (Fath), and Muslim in 1/495 no. 714. It is also found in all the Sunan works, and it has been mentioned previously with similar wordings.