Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.141A.

Section : How to make Istikharah.

For this purpose one should pray two non-obligatory raka’at of prayer, even if they are of the regular sunnah prayers or a prayer for entering the mosque, and so on, during any time of the day or night. One should recite in them whatever one wishes of the Qur’an, after reciting al-Fatihah. Then one should praise Allah and invoke blessings upon the Prophet, peace be upon him. After this one should supplicate to Allah with the following supplication, which Jabir Ibn ‘Abdullah has reported from the Prophet, peace be upon him, when he related, “The Prophet, peace be upon him, taught us how to make Istikharah in all (our) affairs, just as he taught us various surahs of the Qur’an. He told us, ‘If anyone of you considers doing something he should offer a two-rak’at prayer other than the obligatory prayers, and then say (after the prayer), “Allahumma inni astakhiruka bi’ilmika. wa astaqdiruka bi-qudratika, wa as’aluka min fadlika al-azimfa-innaka taqdiru wala aqdiru, wa ta’lamu wala a ‘lamu, wa anta ‘allamu-l-ghuyub. Allahumma, in kunta ta’ lamu anna hazhaI-amra khairun lifi dini wa ma’ashi wa aqibati amri (or ‘ajili amri wa’ajilihi) f aqdirhu li wa yas-sirhu li thumma barik li fihi, wa in kunta ta’llamu anna hazha-l-amra sharrun lifi dini wa ma’ashi wa-aqibati amri (orfi’ajili amri wa ajilihi) fasrifhu anni was-rifni’anhu. Wa aqdir li al-khaira haithu kana thumma ardini bihi (O Allah ! I ask guidance from Your knowledge, and Power from Your Might and I ask for Your great blessings. You are capable and I am not. You know and I do not and You know the unseen. O Allah! If You know that this thing is good for my din and my subsistence and for my Hereafter – (or say, If it is better for my present and later needs) – then ordain it for me and make it easy for me to obtain, and then bless me in it. If You know that this thing is harmful to me in my din and subsistence and in the Hereafter (or say, If it is worse for my present and later needs) – then keep it away from me, and keep me away from it. And ordain for me whatever is good for me, and make me satisfied with it).”‘ The Prophet, may peace be upon him, added that then the person should mention his need.”

There is nothing authentic concerning anything specific that is to be recited in the prayer nor is there any authentic report concerning how many times one should repeat it.

An-Nawawi holds that “after making 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, for otherwise he is not 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 abandon what one desired oneself.”