From Al-Ghazali‘s Deliverance from Error (R.J. Mccarthy, S.J. translation). The core of the passage – attend to the truth, not the person who says it – seems a favorite of his as he makes several times.
This is the practice of those dim-witted men who know the truth by men, and not men by the truth. The intelligent man, on the contrary, follows the advice of the Master of the Intelligent, Ali – God be pleased with him! – where he says: “Do not know the truth by men, but rather, know the truth and you will know its adherents.” The intelligent man, therefore, first knows the truth, then he considers what is actually said by someone. If it is true, he accepts it, whether the speaker be wrong or right in other matters. Indeed, such a man will often be intent on extracting what is true from the involved utterances of the erring, since he is aware that gold is usually found mixed with dirt. The money-changer suffers no harm if he puts his hand into the sack of the trickster and pulls out the genuine pure gold from among the false and counterfeit coins, so long as he can rely on his professional acumen. It is not the expert money-changer, but rather the inexperienced bumpkin who must be restrained from dealing with the trickster. Likewise, a clumsy and stupid person must be kept away from the seashore, not the proficient swimmer; and a child must be prevented from handling a snake, not the skilled snake charmer.