Jabir reported Allah's Messenger (ﷺ) as saying
If anyone sees a dream which he does not like, he should spit on his left side three times, and seek refuge with Allah from the Satan three times, and let him turn over from the side on which he was sleeping.