Sunan Ibn Majah, Book 35, Hadith 16 (Ibn Majah 3910)

It was narrated from Jabir bin ‘Abdullah that the Messenger of Allah (ﷺ) said:

“If anyone of you sees a dream that he dislikes, let him spit dryly to his left three times and seek refuge with Allah from Satan three times, and turn over onto his other side.”