All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
It is possible to see the Prophet, sallallaahu ‘alayhi wa sallam, in a dream. In fact, whoever sees him in a dream, as he was described in the books of Sunnah, he has truly seen him because the devil cannot take his image, as mentioned in an authentic narration. [Al-Bukhari and Muslim]
However, it is impossible to see the Prophet, sallallaahu ‘alayhi wa sallam, when awake.
It is possible to see the Ka‘bah and the companions in a dream but no one can be certain whether or not his dream is true. Nevertheless, it is impossible to see the companions when awake. This is because if it is impossible to see the Prophet, sallallaahu ‘alayhi wa sallam, when awake, then it goes without saying that this applies to those who are below him in rank.
As regards how to achieve the status of the righteous people, then this is achieved by performing righteous deeds regularly and by being pious and faithful. Allaah Says (what means): {Unquestionably, [for] the Allies of Allaah there will be no fear concerning them, nor will they grieve. Those who believed and were fearing Allaah.}[Quran 10:62-63]
Finally, we ask Allaah The Almighty to make us among the righteous.