Sahih al-Bukhari, Book 91, Hadith 5 (Bukhari 6728)

Narrated Abu Qatada:

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."