There are three kinds of dreams:
1) True dreams, from Allaah Ta`aalaa. These are Bashaaraat (glad-tidings) for the Mu'min. Via true dreams, Allaah Ta`aalaa can show a person a person something of the Aakhirah, or give them some news of something which might happen, or show them the correct path to take or the correct decision to make regarding a particular thing, or have people who have moved to the Aakhirah visit them in these dreams by the Permission of Allaah Ta`aalaa.
2) Evil dreams / Nightmares. These are from Shaytaan. They do it for no reason other than to try and trouble the Muslim.
3) Adhghaathu Ahlaam (mixed-up dreams which have no meaning, and which can result from eating too much before sleeping.)
In one narration mentioned by Imaam an-Nawawi رحمة الله عليه in Kitaab al-Adhkaar, Hadhrat `Aa'ishah رضي الله عنها used to make the following Du`aa (i.e. in order to get true dreams):
اللَّهُمَّ إِنِّي أسألُكَ رُؤْيا صَالِحَةً، صَادِقَة غَيْرَ كاذِبَةً، نافِعَةً غَيْرَ ضَارَّةٍ
Allaahumma Innee As'aluka Ru'yaa Saalihah, Saadiqatan Ghayra Kaadhibah, Naafi`atan Ghayra Dhaarrah. (O Allaah! I ask You for dreams which are pious; true and not false; beneficial and not harmful.)
May Allaah Ta`aalaa grant all of us true dreams, as Bashaaraat.
آمين يا رب العالمين