The Key to Istikhara
The secret is that one’s heart should not be attached to the matter in question, because that will result in a person becoming restless. Being pleased with something means that one’s heart is content with the decree of Allah.
(Summarized from the commentary of al-Hafiz Ibn Hajar (may Allah have mercy on him) on the hadeeth in Saheeh al-Bukhari, Kitaab al-Da’waat and Kitaab al-Tawheed. Also, commentary based on on islamqa.info).