Sunan Ibn Majah Book 35, Hadith 18
“If anyone of you sees a dream that he dislikes, let him turn
over
and spit dryly to his left three times, and ask Allah for its
good
and seek refuge from its evil.”
“(Good) dreams come from Allah and (bad) dreams come from Satan, so if anyone of you sees something that he dislikes, let him spit dryly to his left three times, and seek refuge with Allah from the accursed Satan three times, and turn over onto his other side.”
“A man came to the Prophet (ﷺ) and said: ‘I saw my head was cut off and I saw it rolling away.’ The Messenger of Allah (ﷺ) said: ‘Satan goes to one of you and terrifies him, then he tells people of that the next morning.’”