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)[Al-Bukhari].
App reference: Book 18, Hadith 146
Arabic/English book reference: Book 18, Hadith 1656