Abu Saeed Khudri reported,

He heard the Prophet ﷺ say, "When one of you sees a dream that pleases him, it is from Allah, so let him praise Allah for it and speak of it. But if he sees something else that he dislikes, it is from Satan, so let him seek refuge from its evil and not mention it to anyone, and it will not harm him."

Bukhari 6985

Sahih

حدثنا عبد الله بن يوسف حدثنا الليث حدثني ابن الهاد عن عبد الله بن خباب

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

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

البخاري 6985صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Dream interpretation
Chapter
Visions are from Allah
Numbering
Darussalam 6985
Bukhari 6985