The Messenger of Allah ﷺ said: If anyone hears a man crying out in the mosque about something he has lost, he should say: May Allah not restore it to you, for the mosques were not built for this.
قَالَ رَسُولُ اللَّهِ ﷺ مَنْ سَمِعَ رَجُلاً يَنْشُدُ ضَالَّةً فِي الْمَسْجِدِ فَلْيَقُلْ لاَ رَدَّهَا اللَّهُ عَلَيْكَ فَإِنَّ الْمَسَاجِدَ لَمْ تُبْنَ لِهَذَا