Jabir ibn Abdullah (RA) narrates Rasulallah (SAWS) used to teach us the way of doing Istikhara with as much importance as he used to teach us the Surahs of the Quran. Rasulallah (SAWS) said “If anyone intends to do any work (and is concerned about its final outcome) he should offer 2 rakaat optional salaat and supplicate:
“Oh Allah, I ask guidance by the virtue of Your knowledge and by the virtue of Your power; and I ask from Your great blessing for undoubtedly, You have the power and You are capable and I have no power, You know and I do not, and undoubtedly You are the Knower of all the unseen. Oh Allah! If You know that this matter is good for me regarding my religion and my livelihood and my future wellbeing (or he said: For my future and present affairs ); Then You ordain it for me and make it easy for me and then bless me in it. But if You know that this work is bad for me, regarding my religion and my livelihood and my future wellbeing (or he said: For my future and present affairs), then keep it away from me, and let me be away from it, and ordain good for me wherever it is. And make me be satisfied with it”.
Rasulallah (SAWS) added that the person should name and concentrate on his need when he comes to “Haadhal Amr” (Bukhari)
NOTE: Istikhara means asking Allah for good. For instance it is desirable to perform Istikhara if a person intends sending a proposal somewhere.