What to do if you see a bad dream in Islam?

When we see a nightmare, we get scared of its meaning and its implication for our future. In many hadith of Prophet Muhammad ﷺ, he has told us 5 things to do when we see a bad dream.

Types of Dreams
According to one Hadith of Prophet Muhammad ﷺ, there are 3 types of dreams in Islam;

Good dreams come from Allah.
Bad dreams come from Shaytan.
A suggestion of one’s own mind.
Sahih Muslim 2263a.

What to do if you see a bad dream?
A Muslim should perform all or most of these acts as soon as he gets up from sleeping after seeing a bad dream to avoid its negative impact on the future.

Offer 2 Nafal prayers.
Recite dua: لا حول ولا قوة إلا بالله three times.
Spit dryly to his left three times.
Turn over onto his other side.
Do not tell your dream to anyone else.
The above-mentioned acts are supported by different Hadith of Prophet Muhammad ﷺ as quoted below.

Hadith related to Bad Dreams
Prophet Muhammad ﷺ said: If any one of you see a bad dream, stand up and offer prayer and do not relate it to people – Sahih Muslim 2263a.

Prophet Muhammad ﷺ said: If anyone of you sees a bad dream, he should seek refuge with Allah from its evil, and he should not mention it to anybody, for it will not harm him. – Sahih al-Bukhari 6985

Prophet Muhammad ﷺ said: If anyone of you sees a bad dream;

Let him spit dryly to his left three times.
Seek refuge with Allah from Satan three times.
Turn over onto his other side.
Sunan Ibn Majah 3908.