It has been quoted in the Hadiths that when a person makes an intention for something then he should pray two Rakats Nafl. In the first Rakat after Alhamdo pray 'QuI Yaa Ayyuhal Kafiroon' and in the second Rakat after Alhamdo pray 'QuI Huwallaho Ahad' and then pray the following Dua and with Wuzu face the Qibla and go to sleep. At the beginning of the Dua and at the end, pray Alhamdo and Durood Sharif. The Dua is as follows;
"Allahumma inni Astakhiruka Bi ilmika Wa Astakdiruka Bi Qudratika Wa As'aluka Min Fadlikal Azueemi Fa innaka Taqdiru Wala Aqdiru Wa Ta'lamu Walaa A'lamu Wa anta Allamul Ghuyub Allahumma In kunta Ta'lamu Anna Hazal Amra Khairulli Fi Deeni Wa Ma'aashi Wa Aaqibati Amri Wa Aajili Amri Wa'Aajilihi Faqdurhuli Wa Yasirrihuli Summa Baarikli Feehi Wa'inkunta Ta'lamu Anna Hazal Amra Sharruli Fi Deeni Wa ma'aashi Wa'Aaqibati Amri Wa Aajili Amri Wa Aajilihi Fa'asrif'hu Anni Wa as'rifni Anhu Waqdur liyal Khaira Haiysu Kaana Summa Raddini Bihi"At both 'Al Amra' mention your request. Just like in the first one say 'Haza Safara Khairuli' and in the second one say "Haza Safara Sharruli' [Guniya].
When should Istikhara be done ?
- Rule: There is no Istikhara for pious actions such as Hajj, Jihad etc. However, you can perform Istikhara to designate a fixed time for them [Guniya].
- Rule: It is better to perform Istakhara at least seven times and then see wherever your conscience is fixed that is what is best for you. Many pious Buzrukhs say that if you see whiteness or greenery in your dreams then it is good and if you see darkness or redness then it is a bad thing and you should stay away from it [Radd-ul-Mohtar].