Imam Sadiq (a.s) narrates that “one who recites this supplication for 40 mornings; he will be accounted amongst the helpers of Imam Mahdi (a.t.f.s). And if he happens to die before the reappearance of Imam Mahdi (a.t.f.s), Allah will raise him up from his grave so that he may assist the holy Imam (a.t.f.s).
For every word that he recites in this supplication, Allah will grant him 1000 good deeds and will erase from his scroll of deeds 1000 sins”. As the title suggests, this supplication is of allegiance (ahad) to the holy Imam (a.t.f.s). Its recitation every morning ensures the renewal of this covenant as taught by Imam Ali ibne Abi Talib (as).
Du’a al-‘Ahd has been narrated from Imam al-Sadiq (a). Sayyid b. Tawus in Misbah al-za’ir, Ibn Mashhadi in al-Mazar al-kabir, al-Kaf’ami in al-Misbah and al-Balad al-amin and Majlisi in Bihar al-anwar and Zad al-ma’ad have mentioned this supplication. Mentioning this supplication by great scholars such as Sayyid b. Tawus, al-Kaf’ami and ‘Allama Majlisi shows their trust on it. The messages of this supplication have been approved in other supplications as well.
You do it in the morning, either before or after fajr prayers. If you intend to do it after the prayers then you should finish the namaz by saying Salaam and then read dua e Ahad. You can get up from the prayer mat and sit on a chair or go to another room if you want. It has to be done for 40 days consecutively.