How to Pray Istikharah
Question

How do I pray salat al istikharah, and at what times? Are there special du’as that I can read for different circumstances?
Praise be to Allah.How to pray Istikharah
The description of Salat al-Istikharah (istikharah prayer) was reported by Jabir ibn ‘Abd-Allah al-Salami (may Allah be pleased with him) who said:
The Messenger of Allah (peace and blessings of Allah be upon him) used to teach his Companions to make istikharah in all things, just as he used to teach them surahs from the Quran. He said: If any one of you is concerned about a decision he has to make, then let him pray two rak’ahs of non-obligatory prayer, then say: Allahumma inni astakheeruka bi ‘ilmika wa astaqdiruka bi qudratika wa asaluka min fadlika, fa innaka taqdiru wa la aqdir, wa ta’lamu wa la a’lam, wa anta ‘allam al-ghuyoob. Allahumma fa in kunta ta'lamu hadhal-amra (then the matter should be mentioned by name) khayran li fi ‘ajil amri wa ajilihi (or: fi deeni wa ma’ashi wa ‘aqibati amri) faqdurhu li wa yassirhu li thumma barik li fihi. Allahumma wa in kunta ta'lamu annahu sharrun li fi deeni wa ma’ashi wa ‘aqibati amri (or: fi ‘ajili amri wa ajilihi) fasrifni ‘anhu [wasrifhu ‘anni] waqdur li al-khayr haythu kana thumma raddini bihi (O Allah, I seek Your guidance [in making a choice] by virtue of Your knowledge, and I seek ability by virtue of Your power, and I ask You of Your great bounty. You have power, I have none. And You know, I know not. You are the Knower of hidden things. O Allah, if in Your knowledge, this matter (then it should be mentioned by name) is good for me both in this world and in the Hereafter (or: in my religion, my livelihood and my affairs ), then ordain it for me, make it easy for me, and bless it for me. And if in Your knowledge it is bad for me and for my religion, my livelihood and my affairs (or: for me both in this world and the next), then turn me away from it, [and turn it away from me], and ordain for me the good wherever it may be and make me pleased with it.
(Reported by al-Bukhari, 6841; similar reports are also recorded by al-Tirmidhi, al-Nasai, Abu Dawood, Ibn Majah and Ahmad)
Commentary on the hadith of istikharah
Ibn Hajr (may Allah have mercy on him) said, commenting on this hadith:
“Istikharah is a word which means asking Allah to help one make a choice, meaning choosing the best of two things where one needs to choose one of them.
Concerning the phrase The Messenger of Allah (peace and blessings of Allah be upon him) used to teach us to make istikharah in all things, Ibn Abi Jamrah said: It is a general phrase which refers to something specific. With regard to matters that are wajib (obligatory) or mustahabb (liked or encouraged), there is no need for istikharah to decide whether to do them, and with regard to matters that are haram (forbidden) or makrooh (disliked), there is no need for istikharah to decide whether to avoid them. The issue of istikharah is confined to matters that are mubah (allowed), or in mustahabb matters when there is a decision to be made as to which one should be given priority. I say: it refers to both great and small matters, and probably an insignificant issue could form the groundwork for a big issue.
The phrase If any one of you is concerned appears in the version narrated by Ibn Mas’ud as: if any one of you wants to do something
Let him pray two rak’ahs of non-obligatory prayer. This is mentioned to make it clear that it does not mean Fajr prayer, for example. Al-Nawawi said in al-Adhkar: He can pray istikarah after two rak’ahs of regular sunnah prayer done at zhuhr for example, or after two rak’ahs of any nafl prayers whether they are regularly performed or not It seems to be the case that if he made the intention to pray istikharah at the same time as intending to pray that particular prayer, this is fine, but not if he did not have this intention.
Ibn Abi Jamrah said: The wisdom behind putting the salat before the du’a is that istikharah is intended to combine the goodness of this world with the goodness of the next. A person needs to knock at the door of the King (Allah), and there is nothing more effective for this than prayer, because it contains glorification and praise of Allah, and expresses one's need for Him at all times.
The phrase then let him say would seem to imply that the du’a should be said after finishing the prayer, and the word thumma (then) probably means after reciting all the words of the salat and before saying salam.
The phrase O Allah, I seek Your guidance by virtue of Your knowledge is explaining because You know best. Similarly, by virtue of Your power most likely means seeking Your help. I seek ability (astaqdiruka) means I ask You to give me the power or ability (qudrah) to do whatever is being asked for, or it probably means I ask You to decree (tuqaddir) this for me. So it may mean making it easy.
I ask You of Your great bounty refers to the fact that Allah gives out of His great generosity, but no one has the right to His blessings. This is the opinion of Ahl al-Sunnah.
You have power, I have none. And You know, I know not refers to the fact that power and knowledge belong to Allah alone, and the slave has no share of them except what Allah decrees for him.
O Allah, if in Your knowledge this matter, according to one report, he should mention it by name. It is apparent from the context that he should state it, but it is probably sufficient to be thinking of the matter whilst making this du’a.
Then ordain it for me means make it happen for me or it may mean make it easy for me.
Then turn it away from me, and turn me away from it means so that my heart will no longer feel attached to it after it has been turned away.
Make me pleased with it means make me content with it, so that I will never regret asking for it or be sorry that it happened, because I do not know how it will turn out, even if at the time of asking I am pleased with it.
The secret is that one’s heart should not be attached to the matter in question, because that will result in a person becoming restless. Being pleased with something means that one’s heart is content with the decree of Allah.” (Summarized from the commentary of al-Hafiz Ibn Hajar (may Allah have mercy on him) on the hadeeth in Saheeh al-Bukhari, Kitab al-Da’wat and Kitab al-Tawheed.)
And Allah knows best.