No one who asks his Lord to choose for him by His knowledge, which encompasses all things, seeks His enablement through His perfect power over all things, and asks Him—glory be to Him—of His immense bounty will ever regret it.
Jābir—may Allah be pleased with him—said: “The Messenger of Allah—peace and blessings be upon him—used to teach us istikhāra in all matters just as he taught us a surah of the Quran.” This indicates the Prophet’s—peace and blessings be upon him—great concern for this supplication, his constancy in observing it, and the care he devoted to it.
His words, “He would tell us: When any one of you intends to undertake a matter,” refer to matters whose outcome is unknown, such as travel, marriage, and the like. There is no istikhāra concerning whether to perform an obligation or refrain from something prohibited.
His words, “Let him then perform two rakʿahs apart from the obligatory prayer,” mean that he should perform two rakʿahs other than the obligatory prayers, so that his prayer may be a means of opening the way to goodness, a cause for his request to be answered, and a means of attaining what he seeks. None of the various narrations of the hadith specifies particular Quranic verses or surahs to be recited in this prayer. The person performing istikhāra should therefore recite whatever Allah makes easy for him from the Quran, without adhering to any particular passage.
His words, “Then let him say,” apparently indicate that the supplication is to be made after completing the prayer—that is, after concluding it with the salām. It is also possible that it should be made before the salām, after completing the prayer’s remembrances and supplications. The first view is preferable: the supplication should be made after the salām. It is best to raise one’s hands while supplicating, since raising them is among the causes for supplication being answered.
There is no harm if someone who has not memorized the supplication reads it from a book. He should strive to keep his heart attentive, humble himself before Allah, be sincere in his supplication, and reflect upon the meanings of this magnificent supplication. If he has not memorized it, does not have a book at hand, and needs to perform istikhāra, he should perform two rakʿahs and supplicate as best he can, asking Allah to choose what is best for him.