Hadith
حَدَّثَنَا النُّفَيْلِيُّ، قَالَ سَمِعْتُ زُهَيْرًا، يَقُولُ سَمِعْتُ يَحْيَى بْنَ سَعِيدٍ، يَقُولُ سَمِعْتُ أَبَا سَلَمَةَ، يَقُولُ سَمِعْتُ أَبَا قَتَادَةَ، يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ " الرُّؤْيَا مِنَ اللَّهِ وَالْحُلْمُ مِنَ الشَّيْطَانِ فَإِذَا رَأَى أَحَدُكُمْ شَيْئًا يَكْرَهُهُ فَلْيَنْفُثْ عَنْ يَسَارِهِ ثَلاَثَ مَرَّاتٍ ثُمَّ لْيَتَعَوَّذْ مِنْ شَرِّهَا فَإِنَّهَا لاَ تَضُرُّهُ " .
Abu Qatadah said:I heard the Messenger of Allah (May peace be upon him) say: A good vision comes from Allah and a dream (hulm) from the devil, so when one of you sees what he dislikes, he must spit on his left (three times), and seek refuge in Allah from its evil. It will then not harm him
Sahih · Al-Albani
Sunan Abi Dawud 5021 ·Book 43, Hadith 249·Also available on sunnah.com·