كتاب آداب النوم
4  
The Book of the Etiquette of Sleeping, Lying and Sitting etc
(130)
Chapter: Visions in Dream and matters relating to them
(130)
- باب الرؤيا وما يتعلق بها
Riyad as-Salihin 840
Abu Sa'id Al-Khudri (May Allah be pleased with him) reported:
I heard the Prophet (ﷺ) saying, "When one of you sees a dream that he likes, then it is from Allah. He should praise Allah for it and relate it to (others)."

Another narration adds: Messenger of Allah(ﷺ) said, "He should not report it except to those whom he loves. And if he sees one which he dislikes, then it is from the Satan. He should seek refuge in Allah against its evil and should not mention it to anyone. Then it will not harm him."

[Al- Bukhari and Muslim].

وعن أبى سعيد الخدرى رضى الله عنه انه سمع النبي صلى الله عليه وسلم، يقول‏:‏ ‏ "‏إذا رأى أحدكم رؤيا يحبها، فإنما هي من الله تعالى، فليحمد الله عليها، وليحدث بها -وفى رواية، فلا يحدث بها إلا من يحب- وإذا رأى غير ذلك مما يكره، فإنما هي من الشيطان، فليستعذ من شرها، ولا يذكرها لأحد، فإنها لا تضره‏"‏ (( مُتَّفَقٌ عَلَيهِ)).
Reference : Riyad as-Salihin 840
In-book reference : Book 4, Hadith 28