Istikharah prayer is a two-rak`ah non-obligatory Prayer by which one seeks Allah's guidance when he is confused or can't choose between permissible alternatives. In this case, the Muslim should pray to Allah the Almighty to guide him to whatever He sees fit for him and make his heart satisfied with the decision.
In the Prayer, one asks Allah to facilitate the matter if it is good and turn it away if it is not. Thus, after praying Istikharah, one should decide on a course of action, and trust that if the matter does not work out, it is because it was not good for him. One should not then feel disappointed if things did not go as hoped.
Istikharah is only prescribed for matters deemed permissible by the Shari`ah and not for any issue that plainly opposes Allah's Laws. It is when you have two permissible options and you do not know which is better for you that you should resort to Allah the Almighty to seek His guidance.
In response to your question, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
“Istikharah means, "seeking the best course of action." In Islam, it is used for approaching Allah through Prayer for guidance in a case when one cannot make up his mind. It should, however, be pointed out, that Istikharah applies strictly to cases that are halal (lawful or permissible), since there cannot be a question of choice concerning matters that are considered haram (unlalwful or impermissible).
When faced with important decisions in life, a believer is persuaded to use all of his Allah-given resources, as well as to consult people who are known for their knowledge, piety and sound opinion. After having done so, he can turn to Allah for guidance.
Humans are limited in knowledge, and Allah alone possesses perfect knowledge. Allah has told us that He alone possesses the keys to all that is good. He has also promised to help us if we turn to Him earnestly and sincerely.
We see around us people doing all sorts of things for confirmation when faced with important decisions in their life. The Pre-Islamic Arabs resorted to the practice of divining with arrows or the stirring of birds. In modern times, even some of the most prominent people consult astrologers, psychics, gurus or so called spiritual masters. Islam teaches that since Allah alone knows the unseen realities, and He alone is aware of what is good for us in an absolute sense, we must seek His help.
The Prophet (peace and blessings be on him) taught us how to do so. He told us that if we are faced with decisions in life and are unable to make up our mind, we must approach Allah through Prayer. This Prayer is called Prayer of Istikharah. It is a Sunnah or a highly recommended act. The specific method of doing it, is as follows:
First, one must offer a Prayer of two rak`ahs with the intention of seeking guidance from Allah. Then he should offer the following supplication:
"Allahumma inni astakhiruka bi`ilmika, wa astaqdiruka bi-qudratika, wa as'aluka min fadlika al-azim, fa'innaka taqdiru wala aqdiru, wa ta`lamu wa la a`lamu, wa anta `allamu-l-ghuyub.
Allahumma, in kunta ta`lamu anna hadhal-amra [here mention your case] khairun li fi dini wa ma`ashi wa `aqibati 'amri (or 'ajili amri wa`ajilihi) faqdurhu li wa yas-sirhu li thumma barik li fihi.
Wa in ta`lamu anna hadhal-amra sharrun li fi deeni wa ma`ashi wa `aqibati 'amri (or `ajili amri wa ajilihi) fasrifhu `anni was-rifni `anhu, waqdur liya al-khaira haithu kana thumma 'ardini bihi.”
(O Allah, I seek Your help in finding out the best course of action (in this matter) by invoking Your knowledge; I ask You to empower me, and I beseech Your favor. You alone have the absolute power, while I have no power. You alone know it all, while I do not. You are the One Who knows the hidden mysteries. O Allah, if You know this thing (I am embarking on) [here mention your case] is good for me in my religion, worldly life, and my ultimate destiny, then facilitate it for me, and then bless me in my action. If, on the other hand, You know this thing is detrimental for me in my religion, worldly life, and ultimate destiny, turn it away from me, and turn me away from it, and decree what is good for me, wherever it may be, and make me content with it.)
After having done so, he should follow the decision that he is strongly inclined to. If he feels no such inclination, then he should choose one of the options; he can rest assured that Allah will guide his steps. It has been reported that the Prophet, peace be upon him, said, "One who asks Allah for guidance in choosing the best course of action will never be a loser."
It is not at all necessary for a person to have visions or dreams following Istikharah. However, if a person does experience a vision or dream, and he feels strongly about it, he should follow it.” (Source: www.islam.ca)
Imam An-Nawawi (may Allah bless his soul) adds: “After making Istikharah, a person must do what he or she is wholeheartedly inclined to do and feels good about doing and should not insist on doing what he had desired to do before making the Istikharah. And if his or her feelings change, he or she should leave what he or she had intended to do, for otherwise he or she is not leaving the choice to Allah, and would not be honest in seeking help from Allah's power and knowledge. Sincerity in seeking Allah's choice means that one should completely abandon what one desired oneself.”
Also, Dr. Muzammil Siddiqi, former head of the Islamic Society of North America (ISNA) and member of the Fiqh Council of North America, states:
“Doing Istikharah does not mean that one should not use one's reason or experience. Allah the Exalted has commanded us in the Qur'an that we should use our intellect and seek knowledge. If we do not know something, we should ask those who know. But human reason has limitations. We do not know everything; only Allah does know all things. When we are faced with a dilemma then we should turn to Allah to seek His guidance.
After offering Istikharah, you may do whatever is best in your understanding or whatever convinces you. You may repeat the du`a' of Istikharah several times if you are still hesitant. It is not necessary to dream about anything and you do not have to wait for an answer in your dreams. It is reported in a Hadith that the Prophet (peace and blessings be upon him) said: "O Anas, when you intend to do some important things, then seek the good (seek Istikharah) from your Lord seven times and then do that to which your heart (or mind) is inclined, because the good is in it."
Most of the hadiths on this subject do not talk about any dream. However, the famous Hanafi jurist Ibn `Abdeen has suggested in his Hashiyah that one should make the Istikharah Prayer before sleeping, and should sleep after having performed Wudu'. The face should be towards Makkah. If one sees something white or green in one's dream, then the answer is yes, but if one sees something dark or red then the answer is no.
Other jurists of Shafi`i, Maliki, Hanbali and Ja`fari schools say that one should do that which is most convincing. According to Imam Malik, other people can also perform Istikharah on behalf of someone.
There is nothing strange about dreams. If you did not see any dreams, then it does not mean that dreams do not occur. After the Istikharah Prayer, some people may see a dream and some may not. We know that some of our dreams become true. Some time we see something in a dream and it happens exactly the same way later. As there are good dreams and bad dreams, so there are also true and false dreams. The interpretation of dreams is a special knowledge that some people have. In the Qur'an many dreams are mentioned. Prophet Ibrahim (peace be upon him) saw in his dream that he was sacrificing his son. Prophet Yusuf (peace be upon him) had dreams and Allah also gave him the knowledge of interpreting dreams. Prophet Muhammad (peace and blessings be upon him) also sometimes interpreted the dreams of his Companions.”
Taken from: http://www.islamonline.net