Narrated Jabir bin Aballah: The Prophet, pbuh, used to teach us the way of doing Istikhara in all matters [just] as he taught us the Surah of the Qur’an. He said, “if anyone of you decides to do any job he should offer a two Rak’ah Salat other than the obligatory ones and say (as follows). “Oh God I consult You as You are All-Knowing, and appeal to You to give me power as You are Omnipotent. And I ask You for your great favor, for You have power, but I don’t. And You have knowledge but I don’t have. You know all hidden matters. Oh God, if You know that this matter is good for me in my religion, my livelihood, and for my life in the Hereafter (or said: for my present and future life), then do it for me. And if You know that this matter is not good for me in my religion, my livelihood, and for my life in the Hereafter (or 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 and wherever it is, and please me with it. The Prophet, pbuh, added that the person should name (mention / be conscious of) his need (matter, etc.)

—Sahih Al- Bukhari – # 2: 263