It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that he said: "The Messenger of Allah (peace and blessings be upon him) taught us the istikharah, and he (peace and blessings be upon him) said: 'Each of you should say (this supplication): "Allahumma inni astakhiruka bi ilmika, wa astaqdiruka bi qudratika, wa as'aluka min fadlika, fa innaka taqdiru wa la aqdiru, wa ta'lamu wa la a'lamu, wa anta allamul-ghuyub. Fa in kana kadha wa kadha" (and here he names his matter) "khayran li fi dini wa fi ma'ishati, wa khayran li fi aqibati amri, wa khayran li fil-umuri kulliha, faqdurhu li, wa barik li fihi, wa in kana ghayru dhalika khayran li, faqdur liyal-khayra haythu kana wa raddini bihi" (O Allah, I seek good from You by Your knowledge, I seek power from You by Your power, and I ask You of Your bounty; for You have power and I have no power, You know and I do not know, and You are the Knower of all hidden things. (O Allah,) if this matter (such-and-such a task) is better for me in my religion, my life and the outcome of my affairs, indeed better for me in all matters, then decree it for me and bless me in it. And if something other than it is better for me, then decree for me the good wherever it may be, and then make me pleased with it).'"
Hadith Referenceالمعجم الأوسط / باب الألف / 935
Hadith Gradingمحدثین:فيه من لا يُعرف
Hadith Takhrij«قال الهيثمي: فيه من لم أجد من ترجمه «مجمع الزوائد ومنبع الفوائد، ج 2، ص 281»» «أخرجه الطبراني فى «الكبير» برقم: 11477»