Abu Saeed Khudri reported,

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."

Azami 11682

Sahih

عن أبي سعيد الخدري

أنه سمع النبي ﷺ يقول: إذا رأى أحدكم رؤيا يحبها فإنما هي من الله، فليحمد الله عليها، وليحدث بها، وإذا رأى غير ذلك مما يكره فإنما هي من الشيطان، فليستعذ من شرها، ولا يذكرها لأحد، فإنها لا تضره.

الأعظمي 11682صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Dreams and their interpretation
Chapter
Medicine
Section
One who sees a dream he likes
Numbering
Jami al-Kamil 11682 (2nd edition)
Azami 11682