Jabir bin Abdullah reported,

The Prophet ﷺ used to teach us the prayer of seeking guidance for all matters, just as he taught us a surah from the Quran. He would say, "When any of you is concerned about a matter, let him pray two units of prayer, then say, 'O Allah, I seek Your guidance through Your knowledge, and I seek Your power through Your power, and I ask You from Your immense bounty, for You have power and I have none, You know and I do not, and You are the Knower of the unseen. O Allah, if You know that this matter is good for me in my religion, my livelihood, and the outcome of my affairs,' or he said, 'in the immediate and distant future of my affairs, then decree it for me. And if You know that this matter is bad for me in my religion, my livelihood, and the outcome of my affairs,' or he said, 'in the immediate and distant future of my affairs, then turn it away from me and turn me away from it, and decree for me what is good wherever it may be, then make me content with it.' And he should mention his need."In another narration it was added, "Other than the obligatory prayer."

Azami 11086

Sahih

عن جابر قال

كان النبي ﷺ يعلمنا الاستخارة في الأمور كلها كالسورة من القرآن، إذا هم بالأمر، فليركع ركعتين، ثم يقول: اللهم إني أستخيرك بعلمك، وأستقدرك بقدرتك، وأسألك من فضلك العظيم، فإنك تقدر ولا أقدر، وتعلم ولا أعلم، وأنت علام الغيوب، اللهم إن كنت تعلم أن هذا الأمر خير لي في ديني ومعاشي وعاقبة أمري-أو قال في عاجل أمري وآجله- فاقدره لي، وإن كنت تعلم أن هذا الأمر شر لي في ديني ومعاشي وعاقبة أمري- أو قال في عاجل أمري وآجله- فاصرفه عني واصرفني عنه، واقدر لي الخير حيث كان، ثم رضني به، ويسمي حاجته. وزاد في رواية: من غير الفريضة.

الأعظمي 11086صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Supplications of adhan and prayer, and what is related to them
Section
Supplication of the istikhara prayer
Numbering
Jami al-Kamil 11086 (2nd edition)
Azami 11086