Sahih al-Bukhari, Book 59, Hadith 101 (Bukhari 3157)

Narrated Abu Qatada:

as below. Narrated Abu Qatada: The Prophet (ﷺ) said, "A good dream is from Allah, and a bad or evil dream is from Satan; so if anyone of you has a bad dream of which he gets afraid, he should spit on his left side and should seek Refuge with Allah from its evil, for then it will not harm him."