Jabir (may Allah be pleased with him) narrated: "The Messenger of Allah (ﷺ) taught us to seek guidance (Istikhara) in all matters, just as he taught us a Surah from the Quran. He said: 'When one of you is concerned about a matter, let him pray two rak'ahs of voluntary prayer, then say:
"O Allah, I seek Your guidance by Your knowledge, and I seek ability by Your power, and I ask You from Your immense favor. For You are capable, and I am not. You know, and I do not. You are the Knower of the unseen. O Allah, if You know that this matter is good for me in my religion, my livelihood, and the outcome of my affairs—or he said: in this life and the hereafter—then decree it for me, make it easy for me, and bless it for me. But if You know that this matter is harmful for me in my religion, my livelihood, and the outcome of my affairs—or he said: in this life and the hereafter—then turn it away from me and turn me away from it. Decree for me what is good wherever it may be, and make me content with it."'
He should then mention his need."