All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad (
) is His slave and Messenger.
This hadith was narrated by At-Tirmidhi
in his Sunan from Sa'd ibn Abi Waqqas
who reported that the Messenger of Allah (
) said: “The supplication of Dhun-Nun (Yunus) when he called out while in the belly of the whale was: ‘Lā ilāha illā Anta, subḥānaka innī kuntu minaẓ-ẓālimīn’ (‘There is no deity worthy of worship except You; Glory be to You. Indeed, I have been among the wrongdoers.’) No Muslim man supplicates with it concerning any matter except that Allah responds to him.”
Al-Hakim
said in Al-Mustadrak: “Its chain of narration is authentic.”
Ibn Hajar al-Asqalani
said in Natā’ij al-Afkār: “It is a good (ḥasan) hadith.”
Therefore, it is permitted for you to supplicate with this invocation whenever you have a need or seek something from Allah. However, doing so is not obligatory. If you make du‘ā’ using other words that are appropriate to your particular need, without mentioning this supplication, there is no sin or blame upon you.
Allah Knows best.