The Prophet ﷺ said, "A good dream that comes true is from Allah, and a bad dream is from Satan, so if anyone of you sees a bad dream, he should seek refuge with Allah from Satan and should spit on the left, for the bad dream will not harm him."
عَنِ النَّبِيِّ ﷺ قَالَ الرُّؤْيَا الصَّالِحَةُ مِنَ اللَّهِ وَالْحُلْمُ مِنَ الشَّيْطَانِ فَإِذَا حَلَمَ فَلْيَتَعَوَّذْ مِنْهُ وَلْيَبْصُقْ عَنْ شِمَالِهِ فَإِنَّهَا لاَ تَضُرُّهُ وَعَنْ أَبِيهِ حَدَّثَنَا عَبْدُ اللَّهِ بْنُ أَبِي قَتَادَةَ عَنْ أَبِيهِ عَنِ النَّبِيِّ ﷺ مِثْلَهُ