The Prophet ﷺ said, "Dreams are of three kinds. Some are good news from Allah, some are the soul's own musings, and some are intimidations from Satan. If any of you sees a dream that pleases him, let him relate it if he wishes. But if he sees something he dislikes, let him not tell anyone about it, and let him get up and pray."
حدثنا أبو بكر بن أبي شيبة حدثنا هوذة بن خليفة حدثنا عوف عن محمد بن سيرين
عن النبي ﷺ قال الرؤيا ثلاث فبشرى من الله وحديث النفس وتخويف من الشيطان فإن رأى أحدكم رؤيا تعجبه فليقص إن شاء وإن رأى شيئا يكرهه فلا يقصه على أحد وليقم يصلي
Bukhari related it in the Book of Dream Interpretation, Chapter on Being Fettered in a Dream, no. 7017, from the hadith of Awf Arabi, at greater length. Muslim also related it, no. 6/2263, and others, from the hadith of Muhammad bin Sirin, at greater length. See no. 3917.