On the authority of Jabir Ibn Abdullah (ra) he said: The Prophet would instruct us to pray for guidance in all of our concerns, just as he would teach us a chapter from the Quran. He (saw) would say If any of you intends to undertake a matter then let him pray two supererogatory units (two rakah nafilah) of prayer and after which he should supplicate:
اللّهُـمَّ إِنِّـي أَسْتَخيـرُكَ بِعِاْـمِك، وَأسْتَقْـدِرُكَ بِقُـدْرَتِـك، وَأَسْـألُـكَ مِنْ فَضْـلِكَ العَظـيم، فَإِنَّـكَ تَقْـدِرُ وَلا أَقْـدِر، وَتَـعْلَـمُ وَلا أَعْلَـم، وَأَنْـتَ عَلاّمُ الغُـيوب، اللّهُـمَّ إِنْ كُنْـتَ تَعْـلَمُ أَنَّ هـذا الأمْـرَ- وَيُسَـمِّي حاجَتَـه – خَـيْرٌ لي في دينـي وَمَعـاشي وَعاقِـبَةِ أَمْـري، فَاقْـدُرْهُ لي وَيَسِّـرْهُ لي ثـمَّ بارِكْ لي فيـه، وَإِنْ كُنْـتَ تَعْـلَمُ أَنَّ هـذا الأمْـرَ شَـرٌ لي في دينـي وَمَعـاشي وَعاقِـبَةِ أَمْـري، فَاصْرِفْـهُ وَاصْرِفْني عَنْـهُ وَاقْـدُرْ لي الخَـيْرَ حَيْـثُ كانَ ثُـمَّ أَرْضِـني بِـه
O Allah, I seek Your counsel by Your knowledge and by Your power I seek strength and I ask You from Your immense favour, for verily You are able while I am not and verily You know while I do not and You are the Knower of the unseen. O Allah, if You know this affair -and here he mentions his need- to be good for me in relation to my religion, my life, and end, then decree and facilitate it for me, and bless me with it, and if You know this affair to be ill for me towards my religion, my life, and end, then remove it from me and remove me from it, and decree for me what is good wherever it be and make me satisfied with such. One who seeks guidance from his Creator and consults his fellow believers and then remains firm in his resolve does not regret, for Allah has said: وَشـاوِرْهُـم في الأمْـرِ فَـإِذا عَـزَمْـتَ فَتَوَكّـلْ عَلـى الله( …and consult them in the affair. Then when you have taken a decision, put your trust in Allah… (chapter 3 verse 159)
Source: Hisnul Muslim