The Messenger of Allah ﷺ said, "If you say to your companion, 'Be quiet,' while the imam is delivering the sermon, you have spoken idly."
أخبرنا محمد بن سلمة والحارث بن مسكين قراءة عليه وأنا أسمع واللفظ له عن ابن القاسم قال حدثني مالك عن ابن شهاب عن ابن المسيب
أن رسول الله ﷺ قال إذا قلت لصاحبك أنصت والإمام يخطب فقد لغوت
[Its chain of transmission is sahih] Abu Dawud narrated it in the Book of Prayer, chapter "Speaking While the Imam Delivers the Sermon," Hadith 1112, from the hadith of Malik through this route, and it is found in the Muwatta, narration of Ibn Qasim, Hadith 13, and in Kubra, Hadith 1780. Bukhari also narrated it, Hadith 934, as did Muslim, Hadith 851, and others, through the route of Aqeel bin Khalid from Zuhri by this route, and he explicitly stated that he had heard it directly.