Al-Kāfi - Volume 3 > Salah (prayer) for Istikharah (asking Allah to Choose for One What Is Good)
Hadith #7

7ـ عَلِيُّ بْنُ مُحَمَّدٍ عَنْ سَهْلِ بْنِ زِيَادٍ عَنْ مُحَمَّدِ بْنِ عِيسَى عَنْ عَمْرِو بْنِ إِبْرَاهِيمَ عَنْ خَلَفِ بْنِ حَمَّادٍ عَنْ إِسْحَاقَ بْنِ عَمَّارٍ عَنْ أَبِي عَبْدِ الله (عَلَيْهِ الْسَّلام) قَالَ قُلْتُ لَهُ رُبَّمَا أَرَدْتُ الأمْرَ يَفْرُقُ مِنِّي فَرِيقَانِ أَحَدُهُمَا يَأْمُرُنِي وَالآخَرُ يَنْهَانِي قَالَ فَقَالَ إِذَا كُنْتَ كَذَلِكَ فَصَلِّ رَكْعَتَيْنِ وَاسْتَخِرِ الله مِائَةَ مَرَّةٍ وَمَرَّةً ثُمَّ انْظُرْ أَحْزَمَ الأمْرَيْنِ لَكَ فَافْعَلْهُ فَإِنَّ الْخِيَرَةَ فِيهِ إِنْ شَاءَ الله وَلْتَكُنِ اسْتِخَارَتُكَ فِي عَافِيَةٍ فَإِنَّهُ رُبَّمَا خِيرَ لِلرَّجُلِ فِي قَطْعِ يَدِهِ وَمَوْتِ وَلَدِهِ وَذَهَابِ مَالِهِ.

7. Ali ibn Muhammad has narrated from Sahl ibn Ziyad from Muhammad ibn ‘Isa from ‘Amr ibn Ibrahim from Khalaf ibn Hammad from Ishaq ibn ‘Ammar who has said the following: “I said to abu ‘Abd Allah, ‘Alayhi al-Salam, ‘Sometimes I may get two different opinions: one for and the other against what I think to do, what then I should do?’ The Imam said, ‘If such is the case, then perform two Rak‘at Salah (prayer) and ask Allah, one hundred and one times, to choose for you what is best. Thereafter choose the matter for which your determination is stronger; the choice is for it, by the will of Allah. Your choice should be based on what is safe; sometimes it is better for a man to see his hand cut off, or his son die or his property gone.”’