The Supplication of the Istikhara Prayer:
Jabir ibn Abdullah (may Allah be pleased with them both) said: The Messenger of Allah ﷺ used to teach us to seek istikhara in all matters, just as he would teach us a surah of the Quran. He would say: When any one of you intends to do something, let him pray two rak’ahs other than the obligatory prayer, then let him say this supplication:
((اللَّهُمَّ إِنِّي أَسْتَخِيرُكَ بِعِلْمِكَ وَأَسْتَقْدِرُكَ بِقُدْرَتِكَ وَأَسْأَلُكَ مِنْ فَضْلِكَ الْعَظِيمِ فَإِنَّكَ تَقْدِرُ وَلَا أَقْدِرُ وَتَعْلَمُ وَلَا أَعْلَمُ وَأَنْتَ عَلَّامُ الْغُيُوبِ اللَّهُمَّ إِنْ كُنْتَ تَعْلَمُ أَنَّ هَذَا الْأَمْرَ خَيْرٌ لِي فِي دِينِي وَمَعَاشِي وَعَاقِبَةِ أَمْرِي فَاقْدُرْهُ لِي وَيَسِّرْهُ لِي ثُمَّ بَارِكْ لِي فِيهِ وَإِنْ كُنْتَ تَعْلَمُ أَنَّ هَذَا الْأَمْرَ شَرٌّ لِي فِي دِينِي وَمَعَاشِي وَعَاقِبَةِ أَمْرِي فَاصْرِفْهُ عَنِّي وَاصْرِفْنِي عَنْهُ وَاقْدُرْ لِيَ الْخَيْرَ حَيْثُ كَانَ ثُمَّ أَرْضِنِي بِهِ))
O Allah! Indeed I seek the good from You through Your knowledge, and I seek strength from You through Your power. And I ask You for Your great bounty. For You have power and I have no power, You know and I do not know, and You are the Knower of the unseen. O Allah! If You know that this matter (here he should name his need) is better for me in my religion, in my livelihood and in the outcome of my affairs, then decree it for me and make it easy for me, then place blessing for me in it. And if You know that this matter is bad for me in my religion, in my livelihood and in the outcome of my affairs, then turn it away from me and turn me away from it, and decree for me the good wherever it may be, then make me pleased with it.
The supplication of istikhara is the one that has been reported in the hadith, and its place is after the salam. No particular time is specified for istikhara.
Whoever seeks istikhara from Allah, consults the people, and carries out the matter with steadfastness will never be regretful or remorseful. Allah, Glorified and Exalted is He, says:
((وَشَاوِرْهُمْ فِي الْأَمْرِ فَإِذَا عَزَمْتَ فَتَوَكَّلْ عَلَى اللَّهِ إِنَّ اللَّهَ يُحِبُّ الْمُتَوَكِّلِينَ))
And consult them in the matter, and when you have firmly resolved on a matter, then put your trust in Allah; indeed, Allah loves those who put their trust in Him.