He heard the Prophet ﷺ say, "When one of you sees a dream that he likes, it is from Allah, so let him praise Allah for it and speak of it. But when he sees something other than that, something he dislikes, it is from Satan, so let him seek refuge from its evil and not mention it to anyone, for then it will not harm him."
أنه سمع النبي ﷺ يقول: إذا رأى أحدكم رؤيا يحبها فإنما هي من الله، فليحمد الله عليها، وليحدث بها، وإذا رأى غير ذلك مما يكره فإنما هي من الشيطان، فليستعذ من شرها، ولا يذكرها لأحد، فإنها لا تضره.