Istikharah is a non-obligatory Prayer by which one seeks Allah’s guidance concerning a matter he is going to do.

It is highly desirable as stated by the hadith narrated by Jabir ibn `Abdullah (may Allah be pleased with him) who said: “The Messenger of Allah (peace and blessings of Allah be upon him) used to teach us to observe Istikharah for all matters, just as he used to teach us a Surah from the Qur’an (al-Bukhari).

In the Prayer, the Muslim implores Allah the Almighty to guide him to whatever He sees fit for him and make his heart satisfied with the decision.

Sheikh Ahmad Kutty, an Islamic scholar, states:
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.”

He adds, “Humans are limited in knowledge, and Allah alone possesses perfect knowledge. He alone knows the unseen realities, and He alone is aware of what is good for us in an absolute sense, and therefore we must seek His help.”

After having Istikharah done, Imam An-Nawawi (may Allah have mercy upon him) clarifies:

“After making Istikharah, a person should 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.”

It becomes clear from the words of Imam An-Nawawi that Istikharah in essence is seeking Allah’s help in taking a decision and that the Muslim should be honest in seeking Allah’s help and abide by His guidance through Istikharah.

A Muslim must be sure that Allah guides to what is best and that Allah’s choice is definitely better and more correct than his own choice.

As for your question about acting against the result of Istikharah, you are not sinful in this case because it is a recommendable act and a du`a. However it is absolutely better and more correct to act in accordance with Istikharah.

May Allah guide us all!