Hadith.1548 - Ziyad al-Qandi narrated from Abd al-Rahim al-Qasir who said:
"I entered Imam Jafar ibn Muhammad Al-Sadiq عليه السلام and said:
'May I be your ransom, I have composed a supplication.'
Imam عليه السلام said: 'Leave aside your composition; if a matter befalls you, then seek help from the Messenger of Allah صلى الله عليه وعلى آله وسلم by praying two rak'ahs, dedicating them to the Messenger of Allah صلى الله عليه وعلى آله وسلم.'
I asked: 'How should I do this?'
Imam عليه السلام said: 'Perform ghusl (ritual purification), pray two rak'ahs, beginning them as you would begin a prescribed prayer (with the opening takbir and intention), and recite the tashahhud as you would in the obligatory prayer. When you finish the tashahhud and say the salutation (Tasleem), say:
"O’ Allah سبحانه وتعالى, You are Peace, and from You comes peace, and to You returns peace. O’ Allah سبحانه وتعالى, send blessings upon Muhammad and the family of Muhammad, and convey my greetings of peace to the soul of Muhammad and the family of Muhammad. Peace be upon them, and the mercy and blessings of Allah سبحانه وتعالى. O’ Allah سبحانه وتعالى, these two rak'ahs are a gift from me to Your Messenger صلى الله عليه وعلى آله وسلم. So reward me for them with what I hope and expect from You through Your Messenger, O’ Guardian of the believers."
Then prostrate (sujud) and say:
"O’ Ever-Living, O’ Self-Sustaining, O’ Living One who does not die, O’ Living One, there is no god but You, O’ Possessor of Majesty and Honor, O’ Most Merciful of the merciful,"
forty times. Then place your right cheek on the ground and say it forty times. Then place your left cheek and say it forty times. Then raise your head, stretch out your hands, and say it forty times. Then bring your hands to your neck and hold your index finger while saying it forty times. Then take hold of your beard with your left hand, weep, or pretend to weep, and say:
"O’ Muhammad, O’ Messenger of Allah صلى الله عليه وعلى آله وسلم, I complain to Allah سبحانه وتعالى and to you about my need. I complain to your rightly guided family about my need. Through you, I turn to Allah سبحانه وتعالى in my need."
Then prostrate and say:
"O’ Allah سبحانه وتعالى, O’ Allah سبحانه وتعالى," until you are out of breath. Then say:
"Send blessings upon Muhammad and the family of Muhammad, and do for me (such and such)."
Abu Abdullah عليه السلام said: 'I guarantee by Allah سبحانه وتعالى, the Mighty and Majestic, that his need will be fulfilled before he rises.'"