The Prophet ﷺ said, "A good dream is from Allah, and a bad dream is from Satan. So whoever has seen (in a dream) something he dislikes, then he should spit without saliva, thrice on his left and seek refuge with Allah from Satan, for it will not harm him, and Satan cannot appear in my shape."
النَّبِيُّ ﷺ الرُّؤْيَا الصَّالِحَةُ مِنَ اللَّهِ وَالْحُلْمُ مِنَ الشَّيْطَانِ فَمَنْ رَأَى شَيْئًا يَكْرَهُهُ فَلْيَنْفِثْ عَنْ شِمَالِهِ ثَلاَثًا وَلْيَتَعَوَّذْ مِنَ الشَّيْطَانِ فَإِنَّهَا لاَ تَضُرُّهُ وَإِنَّ الشَّيْطَانَ لاَ يَتَرَاءَى بِي