Source: Fiqh-us-Sunnah, volume 2, number 32 and volume 4, number 141.
Often, we have to make major life-changing decisions: whether to undertake a major project or not, whether to apply for a promotion or not, whether to change career or not, whether to invest in a certain company or not, whether to get married or not, whom to get married to, etc.
Istikhara (Arabic) means to ask Allah to guide one to the right thing concerning any affair in one’s life, especially when one has to choose between two permissible alternatives, e.g. a career choice, getting married, etc. Similarly, a traveller should consult good righteous persons before setting out on a journey, because Allah says, “And consult them (O Prophet) in affairs (of moment),” (Qur’an, 3: 159) and one of the characteristics of the believers is that “they (conduct) their affairs by mutual consultation” (Qur’an, 42: 38). Qatadah said, “Every people who seek the pleasure of Allah and consult with one another are guided to the best course in their affairs.” The traveller should also make istikharah and seek guidance from Allah.
Sa’ d ibn Waqas reported that the Prophet, peace be upon him, said, “Istikharah (seeking guidance from Allah) is one of the distinct favors (of Allah) upon man, and a good fortune for the son of Adam is to be pleased with the judgment of Allah. And a misfortune of the son of Adam is his failure to make istikharah (seeking Allah’s guidance), and a misfortune for the son of Adam is his displeasure with the judgment of Allah.” Ibn Taimiyyah said, “He who seeks guidance from the Creator and consults the creatures will never regret it.”
Salatul Istikharah is a sunnah. It is a prayer that one may pray if one must choose between permissible alternatives: it is two non-obligatory rak’at (that can be recited separately or in combination with the regular sunnah prayers or the prayer for entering the mosque […] during any time of the day or night, and to recite therein whatever one wishes of the Qur’an after reciting al-Fatihah. After the two-rak’ats, one praises Allah and sends salutations to the Prophet sallallahu alehi wasallam and recites the following supplication which has been recorded by al-Bukhari in Jabir’s hadith (see full text below): “The Prophet sallallahu alehi wasallam would teach us al-istikhara for all of our affairs as he would teach us a surah from the Qur’an. He said: ‘If one of you is deliberating over an act, he should pray two non-obligatory rak’at and say: “O Allah, I consult You as You are All-Knowing and I appeal to You to give me power as You are Omnipotent, I ask You for Your great favor, for You have power and I do not, and You know all of the hidden matters . O Allah ! If you know that this matter (then he should mention it) is good for me in my religion, my livelihood, and for my life in the Hereafter, (or he said: ‘for my present and future life,’) then make it (easy) for me. And if you know that this matter is not good for me in my religion, my livelihood and my life in the Hereafter, (or he said: ‘for my present and future life,’) then keep it away from me and take me away from it and choose what is good for me wherever it is and please me with it.”
The Fiqh-us-Sunnah scholars maintain that there is nothing authentic concerning something specific (e.g. specific qur’anic ayats, etc.) that is to be recited in the prayer nor is there any authentic report concerning how many times one should repeat salat-ul-Istikhara.
An-Nawawi holds that “after performing the istikharah, a person must do what he is wholeheartedly inclined to do and feels good about doing and should not insist on doing what he had desired to do before making the istikharah. And if his feelings change, he should leave what he had intended to do, otherwise he is not completely leaving the choice to Allah, and would not be honest in seeking aid from Allah’s power and knowledge. Sincerity in seeking Allah’s choice, means that one should completely leave what he himself had desired or determined.”
Please read the rest here