The speech here is about the invocation of Istikharah which is desirable for a Muslim to say when he intends to do something which its consequences are not known. It was reported in Sahih Al Bukhari on the authority of Jabir ibn `Abdullah (may Allah be pleased with him) who said: "The Prophet (peace be upon him) used to teach us the way of doing Istikhara (Istikhara means to ask Allah to guide one to the right sort of action concerning any job or a deed) in all matters as he taught us the Surahs of the Quran. He said: If anyone of you thinks of doing any action, he should offer a two-Rak`ah Salah other than the compulsory ones and say (after Salah): 'Allahumma inni Astakhiruka Bi`ilmika, Wa Astaqdiruka Bi-Qudratika, Wa As'aluka Min Fadlika Al `Azim Fa-innaka Taqdiru Wala Aqdiru, Wa Ta`lamu Wala A`lamu, Wa anta `Allamul-Ghuyub. Allahumma, in Kunta Ta`lam Anna Hadha-l-Amra Khairun Li Fi Dini Wa Ma`ashi Wa`aqibati Amri (or `Ajili Amri Wa`ajilihi) Faqdirhu wa Yassirhu Li Thumma Barik Li Fihi, Wa in Kunta Ta`lamu Anna Hadha-lamra Sharrun Li Fi Dini Wa Ma`ashi Wa`aqibati Amri (or Fi`ajili Amri Wa Ajilihi) Fasrifhu `Anni Was-rifni `Anhu. Waqdir Li Al Khayra Haithu Kana Thumma Radini Bihi.' [O Allah! I ask guidance from Your knowledge, 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 action is good for my religion and my subsistence and in my Hereafter —(or said: If it is better for my present and later needs)—, ordain it for me and make it easy for me to get, then bless me in it. And if You know that this action is harmful to me in my religion, subsistence, and in the Hereafter —(or said: If it is worse for my present and later needs)—, keep it away from me and let me be away from it. Then ordain for me whatever is good for me and make me satisfied with it]. The Prophet (peace be upon him) added: Then the person should name (mention) his need." [Reported by Al Bukhari: No. 1162].
You may refer to this Hadith: "The Hadith of Salatul-Istikharah Riwayah wa Dirayah" of Dr. `Asim Al Qaryuty.
This great and blessed invocation —to which the Prophet (peace be upon him) guided his nation to do at every action [i.e., asking for choice in a matter a person does not know its consequences] when a person is hesitant about its consequences: Whether it will lead to goodness or evil, benefit or harm— is the replacement for the Muslim nation rather than the Pre-Islamic practices, such as: Using birds for showing goodness or evil or using diving arrows when a person wants to marry, travel, sell, etc. By those means the people of Pre-Islamic Period sought the knowledge of the unseen but that was error and foolishness. As for the Muslim nation, Allah (may He be Exalted) guided them to the best ways, the keys of goodness, and the ways of happiness in this world and in the Hereafter, and of these ways and keys is this great invocation.
Ibn Al Qayyim (may Allah bestow mercy on his soul) said: Allah guided the nation to this invocation which shows monotheism, humbleness, servitude, confidence in Allah, and asking the One in whose Hands all goodness lies. No one brings goodness but He and no one directs away evils but He. When He opens a mercy for a servant, no one can withhold it and when He withholds it, no one can give, no matter what they do: Whether they seek the help of birds or the help of stars, etc. This invocation is the good omen, the fortune of the people of happiness and success whom were given glad tidings from Allah with Paradise, not the fortune of the polytheists and wretched people who associate others with Allah in worship; surely they shall know their final destination. So, this invocations included admission of the existence of Allah (Glory be to Him), admission of the attributes of His Perfection, admission of His Lordship, referring all matters to Him, seeking His Help, depending on Him, negating one's power and attributing all powers to Allah, admitting a person's helplessness of knowing his own interests and showing disability to achieve it, and knowing that all these matters are in the hands of Allah.
The meaning is: Istikharah means to rely on Allah, delegate all matters to Him, and admit His Ability, Knowledge, and Well-Choice to His Servants. Moreover, Istikharah is one of the prerequisites of satisfying Him as a lord, and a person shall not taste the sweetness of faith if he is not satisfied with the judgment of Allah, however if he is satisfied with destiny, it will be a sign for happiness. [Zad Al Ma`ad of Ibn Al Qayyim 2/443 - 445].
The one who asks his Lord for guidance shall not regret because His Knowledge encompasses everything, and the he resorts to Allah’s Perfect Power over everything and asks Allah (Glory be to Him) from His Ample Favors.
As for the saying of Jabir (may Allah be pleased with him): "The Prophet (peace be upon him) used to teach us the way of doing Istikhara (Istikhara means to ask Allah to guide one to the right sort of action concerning any job or a deed) in all matters as he taught us the Surahs of the Quran," it refers to the Prophet's keenness for teaching his nation this invocation and the importance of keeping to it.
As for his saying: "If anyone of you thinks of doing any action," i.e., any matter which he does not know its consequences such as travel, marriage, etc.
• It is important to say that there is no Istikharah in doing obligatory matters or leaving out forbidden matters.
As for his saying: "He should offer a two Rak`ah Salah other than the compulsory ones," i.e., let him offer two supererogatory Rak`ahs so that his Salah would be like a key to the gates of goodness and a cause to fulfill his needs. There is no certain Surahs to be recited during Salatul-Istikharah, so a person may recite whatever Surahs he wants.
As for his saying: "Then he should say," it is a proof that invocation is said after the end of Salah, or it is probable to recite the invocation before the end of Salah directly after Tash-shahud and invocation, but the first view is more reliable. It is better for a person to raise his hand during invocation because raising them is one of the causes of answering invocations.
There is no harm if a person reads the invocation from a book if he does not memorize it. Furthermore, a person should exert efforts in focusing in Salah, show reverence to Allah, be truthful in invocation, and ponder over the meaning of this great invocation.
In case a person does not memorize the invocation and he does not have a book to read from, he may offer two Rak`ahs and invoke Allah with whatever he wants to fulfill his needs.
As for his saying: "Allahumma Inni Astakhiruka Bi`lmika," i.e., I ask You, O Allah, to choose for me goodness by Your Wide Knowledge which encompasses the past, the future, and the things which are not destined to take place.
As for his saying: "Wa Astaqdiruka Biqudratik," i.e., I ask You to grant me some power to do.
As for his saying: "Wa As'aluka Min Fadlika Al `Azim," i.e., O Allah, I ask You to grant me some of Your Favors because You are the Only Giver of favors; indeed there is no associate to You in worship.
As for his saying: "Fa Innaka Taqdiru wala Aqdir wa Ta`lamu wala A`lam wa Ant `Allamu-l-Ghuyub," i.e., it denotes faiths in the Power of Allah over everything, and showing that nothing is hidden from Him, and admitting the weakness and disability of a person and his dire need to his Lord.
As for his saying: "Allahumma in Kunta Ta`lamu Anna Hadha-l-Amra," i.e., a person should mention the name of that matter [i.e., marriage, sell, travel, etc.].
As for his saying: "In Kunta Ta`lamu," it shows the ignorance of a person to the consequences of matters, but Allah (Glory be to Him) knows everything.
As for his saying: "Khayrun Li Fi Diny wa Ma`ashy wa`aqibata Amri," the Prophet advanced religion because it is the most important, so when religion is safe, a person already has all goodness, but if it is distorted or harmed, there is no goodness afterwards.
As for his saying: "Aw Qala `Ajila Amri Wa Ajilihi," this is a doubt from the narrator, but it is the same meaning.
As for his saying: "Faqdurhu Li wayassirhu Li," i.e., make it easy for me.
As for his saying: "Thumma Barik Li Fih," i.e., make it permanent and double it because blessing includes continuation and the growth of blessings.
As for his saying: "Wa In Kunta Ta`lamu Anna Hadha-l-Amr Sharrun Li...etc," it contains an invocation to Allah to direct away that matter from a person’s mind, destine goodness for him, and grant him satisfaction with Allah's Destiny whether the matter exists or not.
All goodness is in the choice of Allah in whose hands lies success, and He is alone is the one who guides to the Straight Path.