Hadithcore
Riyad as-Salihin, 1656

Masruq (May Allah be pleased with him) said:

We visited 'Abdullah bin Mas'ud (May Allah be pleased with him) and he said to us: O people! He who has the knowledge of any matter may convey it to the others. And he who has no knowledge, thereof, should say: "Allahu a'lam (Allah knows better)." It is a part and parcel of knowledge that a man who has no knowledge of a matter should say: "Allah knows better." Allah said to His Prophet (ﷺ): "Say (O Muhammad (ﷺ)): 'No wage do I ask of you for this (the Qur'an), nor am I one of the Mutakallifun (those who pretend and fabricate things which do not exist)."' (38:86) <b>[Al-Bukhari]</b>.

وعن مسروق قال ‏:‏ دخلنا على عبدالله بن مسعود رضي الله عنه فقال ‏:‏ يا أيها الناس من علم شيئا فليقل به، ومن لم يعلم، فليقل ‏:‏الله أعلم، فإن من العلم أن يقول الرجل لما لا يعلم‏:‏ الله أعلم ‏.‏ قال الله تعالى لنبيه صلى الله عليه وسلم ‏:‏‏{‏قل ما أسألكم عليه من أجر وما أنا من المتكلفين‏}‏‏.‏ ‏(‏‏(‏رواه البخاري‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Book 17, Hadith 146
Sharh · explanationclick to expand
<b>Guidance from the Hadith:</b><br> 1) It informs us of the firm prohibition of affectation and speaking without knowledge.<br> 2) Half of knowledge lies in saying: “Allah knows best” when you do not know.<br> <br> <b>Benefit:</b><br> The erudite scholar Ibn Sa‘di (may Allah have mercy upon him) said:<br> “When a person refrains from speaking about things he does not know, this achieves numerous benefits like the following:<br> - This is what he is required to do.<br> - When he refrains and says: “Allah knows best”, knowledge will readily come to him.<br> - When he refrains from speaking about what he does not know, this indicates his reliability and integrity, as well as his mastery of the things he confidently speaks about, and Allah knows best.” [Al-Fatāwa al-Sa‘diyyah]