Guide
What is the nafs, and how do you control it?
The nafs is the self, especially as it pulls towards what it wants. The Qur'an says the one who purifies it has succeeded (ash-Shams 91:9). The Prophet, peace be upon him, asked Allah to purify his own soul (Sahih Muslim 2722). So the answer has two parts: ask Allah for help, and train the self gradually.
"Control my nafs" is usually typed after a bad night. Something in you wanted a thing, argued for it, and won. Now you want to know what that something is.
It has a name, and the scholars wrote about it at length. Controlling the nafs, in their sense, means training that part of you so that it follows your judgement and stops leading it. A note before we start: the word nafs has wider meanings in Islamic teaching. This page uses one practical sense, the self and its inclinations. It is not a full account of the soul.
What the Qur'an says about the self
"By the soul and the One who proportioned it, and inspired it with its wickedness and its righteousness. He has succeeded who purifies it, and he has failed who buries it."Qur'an, ash-Shams 91:7-10 (meaning in English)

Two things stand out. The self is given both leanings, so the pull you feel is part of how you were made. And the verse speaks of purifying the self. It does not speak of killing it. The aim is a self that is trained.
The three descriptions people call "the three types"
The Qur'an describes the self in three ways:
- Ammara, the self that urges towards wrong: "Indeed the soul is ever inclined to evil, except those upon whom my Lord has mercy" (Yusuf 12:53).
- Lawwama, the self that blames itself: "And I swear by the self-reproaching soul" (al-Qiyamah 75:2).
- Mutma'inna, the self at rest: "O soul at rest, return to your Lord, well pleased and pleasing" (al-Fajr 89:27-28).
Imam al-Ghazali discusses these in the Ihya (the books on the marvels of the heart and on training the self), and Ibn al-Qayyim discusses them in Madarij al-Salikin. Our book summarises both as treating the three as conditions of one self. They are not presented as three separate souls, and they are not ranks to claim.
That last point matters. Please do not use this list to diagnose yourself. Nobody can tell you which description fits you, and the teachers warned against announcing a station. The words are useful for a simpler reason. They show that the pull towards wrong, and the regret afterwards, are both named in the Qur'an. You are not the first person to meet either.
The dua the Prophet taught
The Prophet, peace be upon him, used to say within a longer supplication (Sahih Muslim 2722):
Allahumma ati nafsi taqwaha, wa zakkiha anta khayru man zakkaha, anta waliyyuha wa mawlaha.
"O Allah, grant my soul its mindfulness of You, and purify it. You are the best to purify it. You are its Guardian and its Master."
The report sets no number of times and no fixed occasion for it. Say it in your own supplication, when you want to. Note what it admits. Even the purifying is asked for. You make the effort, and you ask, together.
Strength, as the hadith defines it
The Prophet, peace be upon him, said: "The strong one is not the one who overpowers people. The strong one is the one who controls himself when angry" (Sahih al-Bukhari 6114, meaning in English).
He also gave a physical instruction for that moment. If you become angry while standing, sit down. If the anger does not leave, lie down (Sunan Abi Dawud 4782, graded sahih by al-Albani).
Notice the method. He did not say to argue with the anger. He said to change position. The body moves first, and the urge loses some of its force.
Al-Ghazali's approach in the Ihya, as our book summarises it, runs the same way. You do not defeat the self by general effort. You pick one small habit and go against it steadily until the opposite becomes ordinary. For anger in particular, see How do you control anger in Islam?
One thing to try: the delayed response
This is our own exercise, built on that hadith and those works. It is not a ruling and it adds nothing to the prayer itself.
Do not refuse the urge. Delay it.
- Tonight, while you are calm, choose a fixed delay. Twenty minutes is a good length. Do not renegotiate it later.
- When the pull comes, tell yourself: not for twenty minutes. Postponing is easier than forbidding.
- Change your position, as the hadith teaches for anger. If you are standing, sit. If you are lying down, get up and go to another room.
- Fill the gap with one plain thing. Make wudu, or walk to the end of the street and back.
- Do not use the gap to decide. Deciding is the thing you are postponing.
- When the time is up, look again. If the pull is still strong, start another twenty minutes.

Some nights the twenty minutes will end and you will do it anyway. That happens to people who take this seriously. The delay does not lock anything. It adds friction, and friction works over many repetitions. We cannot promise how quickly, or how it will feel. If you do fall, the way back is here: How do you make tawbah?
If an urge feels compulsive, or watching your own thoughts is making you more distressed, please speak to a doctor or a mental health professional. A habit exercise is not a treatment.
Questions people ask next
What are the three types of nafs?
They are three descriptions in the Qur'an: the self that urges to wrong (Yusuf 12:53), the self that reproaches itself (al-Qiyamah 75:2) and the self at rest (al-Fajr 89:27). The scholars we draw on treat them as conditions of one self. They are a way of understanding. They are not a test to take.
Is there a dua to control the nafs, in English?
Yes. From Sahih Muslim 2722: "O Allah, grant my soul its mindfulness of You, and purify it. You are the best to purify it. You are its Guardian and its Master." Another report, part of a morning and evening supplication, includes seeking refuge in Allah "from the evil within myself" (Sunan Abi Dawud 5067, graded sahih by al-Albani).
How do you control nafs al-ammara?
The verse that names it also names the answer: "except those upon whom my Lord has mercy" (Yusuf 12:53). So you ask for that mercy, and you take practical means. Delay the urge, and remove what feeds it. We go further into repeated sin here: I pray but I keep sinning.
Is there a dua to control sexual desire?
We did not find a verified supplication worded for that alone, and we would not invent one. The supplications above cover it. The Qur'an's own instruction is physical: lower the gaze (an-Nur 24:30). For anything more specific to your situation, ask a qualified teacher.
Read next
- How do you make tawbah?
- I pray but I keep sinning. Am I a hypocrite?
- How do you control anger in Islam?
- How does salah change your life, and why has it not changed mine?
We are not scholars. We are practising Muslims curating what the scholars of this ummah already wrote, held to the standard of the Qur'an and Sunnah. Verify everything. Ask your local people of knowledge.
This article draws on the "Nafs" section of 120 Classical Practices, one of the eight books in Feel Your Prayer Again.