I used to see (such horrible dreams) that I fell ill. I saw Abu Qatada who also said: I used to see dreams which made me sick until I heard Messenger of Allah ﷺ as saying: Good dreams are from Allah, so if any one of you sees which he likes he should not disclose it to one but whom he loves, but if he sees something which he does not like he should spit on his left side thrice and seek refuge with Allah from the mischief of the Satan and its mischief (i.e. of the dream), and he should not relate it to anyone, then it would not harm him.
وَأَنَا كُنْتُ لأَرَى الرُّؤْيَا فَتُمْرِضُنِي حَتَّى سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ الرُّؤْيَا الصَّالِحَةُ مِنَ اللَّهِ فَإِذَا رَأَى أَحَدُكُمْ مَا يُحِبُّ فَلاَ يُحَدِّثُ بِهَا إِلاَّ مَنْ يُحِبُّ وَإِنْ رَأَى مَا يَكْرَهُ فَلْيَتْفِلْ عَنْ يَسَارِهِ ثَلاَثًا وَلْيَتَعَوَّذْ بِاللَّهِ مِنْ شَرِّ الشَّيْطَانِ وَشَرِّهَا وَلاَ يُحَدِّثْ بِهَا أَحَدًا فَإِنَّهَا لَنْ تَضُرَّهُ