The obsession aspect of OCD affects the ‘Aql — the cognitive aspect of the human psyche. This faulty cognition is the birthplace for irrational beliefs and thoughts, or the mixing of thoughts with beliefs, or the misunderstanding of what an act of worship looks like, thus rendering it unnecessarily difficult, or the feeling of guilt for ruminating over a disgusting or blasphemous thought.
The source fault in these examples is the mind, and this faulty cognition is the primary driving force behind compulsive behaviour. 
As the proverb goes,
“Watch your thoughts, they become your emotions. Watch your emotions, they become your behaviours. Watch your behaviours, they become your habits. Watch your habits, they become your character. Watch your character, it becomes your destiny.” 
So, treatment begins by addressing the mind in order to restore balance, reframing mindsets, and correcting beliefs.
From an Islamic perspective, the thoughts of a person with OCD can be reframed with several points, as follows.
Whisperings cannot be eliminated
The difference between one who has OCD and another who doesn’t is not the experience of whispering, as no human being is exempt. Rather, the difference is in how it is managed.
The one who doesn’t have OCD doesn’t fear these thoughts, separates them from his own, and doesn’t dwell over them, rendering them insignificant background noise.
The one who has OCD does the opposite: they fear the thoughts, cannot separate them from their own, and obsess over them.
According to our Islamic texts, such whisperings cannot be completely eliminated.
إِنَّ النَّفْسَ لَأَمَّارَةٌ بِالسُّوءِ
“Indeed, the inner self is a persistent enjoiner of evil.” 
And in a narration, the Prophet ﷺ said,
ما منكم من أحد إلا وقد وُكِّل به قَرِينُه من الجن وقرينُه من الملائكة
“Every one of you has a companion from the Jinn and another from the angels that have been assigned to him.” 
The companions asked,
“As well as yourself?” 
He ﷺ responded,
وإيَّايَ إلا أن الله أعانني عليه فأسلم فلا يأمرني إلا بخير
“Yes, however Allah helped me and he embraced Islam, so he only instructs me to do good.” 
The first step towards addressing this from a cognitive perspective, therefore, is acceptance.
In fact, there is an intervention in modern psychotherapy known as Acceptance Commitment Therapy (ACT) which has some level of overlap with the above, and has been found to be effective in alleviating symptoms of OCD. 
ACT is a type of therapy that aims to help patients accept what is out of their control, and commit instead to actions that enrich their lives.  It sees negative and inappropriate thoughts as part of the normal human process, and the idea is that the thoughts will eventually stop as a by-product, not a direct goal, of this therapy. 
A wise Muslim therapist needs to be skilful and mindful in explaining to the patient that he or she is not accepting the actual blasphemous thought, but rather accepting that he or she is having the thought itself, and that it is very much possible to have inappropriate thoughts, without believing them, and not be distressed by them at the same time.
This takes us to the second point.
Whisperings are harmless
There are several stages to behavioural change, some warrant closer attention than others. 
|الهاجس||al-Hājis||Passing thought||When a transient image appears in one’s mind and disappears.|
|الخاطر||al-Khātir||Residing thought||This is similar to the above, except that its image remains.|
|حديث نفس||Hadīth Nafs||Inner dialogue||When an inner debate ensues: “Should I? Should I not?”|
|الهمّ||al-Hamm||Desire with no resolve||When one’s soul begins to feel an inclination towards a matter.|
|العزم||al-‘Azm||Determination with resolve||Having a resolute desire and intention (niyyah).|
When one has set a firm intention to act upon his inclination, it is at this point where good deeds or sins are recorded for a person, depending on the nature of what is intended. 
An example of the stages of behaviour
If the thought of alcohol passes through one’s mind and a picture of it appears, this is a hājis. If it settles in the mind, then it is a khātir. If an internal conversation ensues as to whether you should consume it or not, then this is hadīth nafs. If you incline towards it, then it is hamm. If you then resolve to consume it, then it becomes ‘azm.
It is comforting to know that one is unaccountable for all of these levels, with exception to the last. The same can be said about blasphemous thoughts; the fact that they passed through your mind doesn’t mean that your status as a Muslim has changed.
This hierarchy shows that there is a difference between imagination and confirmation, and mixing them up is a huge source of anxiety.
Narrations of the Messenger ﷺ
Thinking of evil things
A man came to the Prophet ﷺ and said,
يَا رَسُولَ اللَّهِ إِنَّ أَحَدَنَا يَجِدُ فِي نَفْسِهِ — يُعَرِّضُ بِالشَّىْءِ — لأَنْ يَكُونَ حُمَمَةً أَحَبُّ إِلَيْهِ مِنْ أَنْ يَتَكَلَّمَ بِهِ
“O Messenger of Allah! Some of us have thoughts, where they would rather be reduced to charcoal than speak about them.” 
He ﷺ replied,
اللَّهُ أَكْبَرُ اللَّهُ أَكْبَرُ اللَّهُ أَكْبَرُ الْحَمْدُ لِلَّهِ الَّذِي رَدَّ كَيْدَهُ إِلَى الْوَسْوَسَةِ
“Allahu Akbar, Allahu Akbar, Allahu Akbar. Praise be to Allah, Who has reduced his plotting to whisperings.” 
Having intrusive thoughts
Similarly, a group of companions came to the Prophet ﷺ and said,
إِنَّا نَجِدُ فِي أَنْفُسِنَا مَا يَتَعَاظَمُ أَحَدُنَا أَنْ يَتَكَلَّمَ بِهِ
“We find ourselves thinking about matters that we deem too grave to express.” 
The Prophet ﷺ asked them,
“Have you really perceived it?” 
He ﷺ replied to them,
ذَاكَ صَرِيحُ الإِيمَان
“That is pure īmān (faith).” 
Lifting of a burden!
As Muslims, this concept of behavioural stages is immensely therapeutic for those who are affected by OCD, in that negative thoughts — far from being a cause for anxiety — are an active sign of strong īmān, as such people’s faith is so strong that Shaytān was only able to give suggestions, with no power to settle such thoughts within them.
This understanding is indeed the lifting of a burden.
Also notice how, in the specific cases above, no practical interventions were suggested. Thoughts are not beliefs, as the latter is what the heart settles upon.
In fact, one may speculate several ideas, even those do not become beliefs until you commit to them.
Certainty isn’t erased by doubt
One of Islam’s legal maxims states,
اليقين لا يزول بالشك
“Certainty is not erased by doubt.”
So, the certainty of your Islam, marriage, cleanliness, correct Salah, etc., is assumed as the default, which is not nullified by doubt.
Thus, whenever terms such as “maybe”, “possibly”, and “I think…” manifest in the mind, all that comes after is not affected.
But what does certainty look like?
It is a situation where you can confidently take an oath in Allah’s Name that something is such. So, you’ve carried out your wudū and you are certain of it as you can take an oath that you have.
Then, maybe a doubt creeps in… “perhaps I missed a spot, or perhaps I passed wind”. The key word there is “perhaps”. Can you now take an oath in Allah’s Name that you have?
If the answer is “no”, then we say that your wudū is certain, and certainty cannot be erased through doubt. The same conversation applies to your Shahadah, your marriage, your Salah, and so on.
Paradise is not earned through perfection
The search for religious perfection often stems from a good place: a desire to glorify Allah and enter Paradise. It is key to remember, however, that we do not enter Paradise through perfection, as not only is it impossible, it was never set as an expectation.
We enter Paradise through Allah’s mercy, as the Prophet ﷺ said,
لَنْ يُدْخِلَ أحَدًا عَمَلُهُ الجَنَّةَ لا
“No one will enter Paradise by way of their deeds.” 
The companions asked,
ولا أنْتَ يا رَسولَ اللَّهِ؟
“Not even you, O Messenger of Allah?” 
لا، ولا أنا، إلَّا أنْ يَتَغَمَّدَنِي اللَّهُ بفَضْلٍ ورَحْمَةٍ
“No, not even I. My only hope is that Allah envelops me with His bounty and mercy.” 
So, there is no escaping falling short, which entails an accidentally deficient wudū at times, accidental statements of blasphemy, accidental statements of divorce, yet in the Eyes of Allah, you are not accountable; your belief is intact, your marriage is valid, and your wudū is complete because it was accidental and perfection is solely Allah’s.
Who is Allah to you?
In some instances, the religious OCD is self-imposed by an understanding of Allah that is fundamentally flawed.
When one’s view of Allah is rectified, one’s view towards religion and one’s self will also be rectified. He is far from being a Lord who hopes for the downfall of people or awaits their mistakes, so as to seize them.
- The One who forgave the sins of a prostitute by way of water that she gave to a thirsty dog using her shoe
- The One who overlooks sins that come by way of forgetfulness or mistake
- The One who instructed Prophet Musa (ʿalayhi al-Salām) to offer gentle words of advice to a man who claimed to be God, despite Allah knowing that the Pharaoh would not take heed
- The One who erases a lifetime’s worth of sin in exchange for a single moment of sincere apology.
This is not a Lord who wishes harm for people, He deserves the best assumptions and highest expectations.
Having understood this, Sufyān al-Thawri said,
مَا أُحِبُّ أَنَّ حِسَابِيَ جُعِلَ إِلَى وَالِدَيَّ؛ رَبِّي خَيْرٌ لِي مِنْ وَالِدَيَّ
“I wouldn’t want my reckoning to be in the hands of my parents on the Day of Judgment. My Lord is better to me than my parents.” 
Allah Himself says…
مَا جَعَلَ عَلَيْكُمْ فِى ٱلدِّينِ مِنْ حَرَجٍۢ
“He has not laid upon you any hardship in the religion.” 
وَلَوْ شَآءَ ٱللَّهُ لَأَعْنَتَكُمْ
“Had Allah willed, He could have made it difficult for you.” 
يُرِيدُ ٱللَّهُ بِكُمُ ٱلْيُسْرَ وَلَا يُرِيدُ بِكُمُ ٱلْعُسْرَ
“Allah intends ease for you, not hardship.” 
“This religion is ease”
Speaking about Islam, the Prophet ﷺ said,
إِنَّ الدِّينَ يُسْرٌ ، وَلَنْ يُشَادَّ الدِّينَ أَحَدٌ إِلاَّ غَلَبَهُ ، فَسَدِّدُوا وَقَارِبُوا وَأَبْشِرُوا
“This religion is ease, and anyone who takes it to extremes will be overcome by it. So remain committed; do your best; and rejoice.” 
We stand up for prayer, yet for those who are unable, they can pray sitting down, and if unable, they can pray laying down.
In the case of menstruating women or those experiencing post-natal bleeding, the obligation of praying is mercifully suspended without a need to make the prayers up.
In the absence of water, wudū can be carried out with the Earth’s dust, and when travelling, people can shorten their prayers from four to two units.
For those who are ill or travelling in the month of Ramadan,
“…then let them fast an equal number of days after Ramadan.” 
And what about those who unintentionally break their fast?
They resume their fast because,
“…it was Allah Who fed him and gave him drink.” 
As for Hajj, should you be unable to perform it for financial or physical reasons, it is not an obligation. Furthermore, even when performing Hajj, Allah recognises people’s need to trade, saying,
لَيْسَ عَلَيْكُمْ جُنَاحٌ أَن تَبْتَغُوا۟ فَضْلًۭا مِّن رَّبِّكُمْ
“There is no blame upon you for seeking bounty from your Lord [during Hajj].” 
And when the Prophet ﷺ was asked by pilgrims regarding actions that they feared they had done incorrectly, he replied to each one of them,
اِفْعَلْ وَلَا حَرَجَ
“Do it, no problem.” 
When addressing prohibited food and drink like swine and alcohol, Allah says,
فَمَنِ ٱضْطُرَّ غَيْرَ بَاغٍۢ وَلَا عَادٍۢ فَإِنَّ ٱللَّهَ غَفُورٌۭ رَّحِيمٌۭ
“…but if someone is compelled by necessity — neither driven by desire nor exceeding immediate need — then, surely, Allah is All-Forgiving, Most Merciful.” 
The Muslim jurists have also looked into the Islamic texts and deduced from them several maxims:
|المشقة تجلب التيسير||Hardship brings about ease, meaning difficult circumstances bring about a relaxation in the rulings.|
|الأمر إذا ضاق اتسع||When circumstances tighten, the ruling widens.|
|الضرورات تبيح المحظورات||Necessities permit the prohibitions.|
Describing the merciful nature of the Shari’ah, Imam Ibn al-Qayyim said,
وَهِي عدل كلهَا، وَرَحْمَة كلهَا، ومصالح كلهَا، وَحِكْمَة كلهَا، فَكل مَسْأَلَة خرجت عَن الْعدْل إِلَى الْجور، وَعَن الرَّحْمَة إِلَى ضدها، وَعَن الْمصلحَة إِلَى الْمفْسدَة، وَعَن الْحِكْمَة إِلَى الْعَبَث فليستْ من الشَّرِيعَة
“The Shari’ah is justice in its entirety, mercy in its entirety, benefits in its entirety, wisdom in its entirety.
“So, every matter that moves from justice to injustice, mercy to cruelty, benefit to harm, or wisdom to foolishness is not part of the Shari’ah.” 
- Understand that whisperings cannot be eliminated, but your response can empower you.
- Take comfort in the advice from our beloved Messenger ﷺ on handling intrusive thoughts.
- Read the final part of this series, which talks about behaviours in breaking the cycle of scrupulosity.
 Badri, M. (2013) Abu Zayd al-Balkhi’s Sustenance of the Soul: The Cognitive Behaviour Therapy of a Ninth Century Physician. The International Institute of Islamic Thought, Herndon.
 Attributed to the Chinese philosopher Lao Tzu, who lived in the 6th century BCE
 al-Qur’ān, 12:53
 Muslim, on the authority of Ibn Mas’ūd; https://sunnah.com/muslim:2814a
 Twohig, M. P., Hayes, S. C., Plumb, J. C., Pruitt, L. D., Collins, A. B., Hazlett-Stevens, H., & Woidneck, M. R. (2010). A randomized clinical trial of acceptance and commitment therapy versus progressive relaxation training for obsessive-compulsive disorder. Journal of consulting and clinical psychology, 78(5), 705–716. https://doi.org/10.1037/a0020508
 Harris, R. (2013). Acceptance and commitment therapy training. Hill, M. L., Masuda, A., Melcher, H., Morgan, J. R., & Twohig, M. P. (2015). Acceptance and Commitment Therapy for women diagnosed with Binge Eating Disorder: A case-series study. Cognitive and Behavioral Practice, 22, 367-378. Retrieved from https://www.actmindfully.com.a/acceptance_&_commitment_therapy
 Harris, R. (2006). Embracing your demons: An overview of Acceptance and Commitment Therapy. Psychotherapy in Australia, 12 (4), 2-8. Retrieved from http://www.livskompass.se/wpcontent/uploads/2012/11/Russ_Harr_A_Non-technical_Overview_of_ACT.2006.pdf
 As mentioned by al-Suyūti in his book al-Ashbāh wa-l-Nadhā’ir
 A poet said,
مراتب القصد خمس هاجس ذكروا * فخاطر فحديث النفس فاستمعا * يليه هم فعزم كلها رفعت * سوى الأخير ففيه الأخذ قد وقعا
 Abu Dāwūd, on the authority of Abdullāh Ibn ‘Abbās; https://sunnah.com/abudawud:5112
 Muslim, on the authority of Abu Hurayrah; https://sunnah.com/muslim:132a
 al-Bukhāri and Muslim, on the authority of Abu Hurayrah; https://sunnah.com/bukhari:6467
 Husn al-Dhann billāh by Ibn Abi al-Dunya
 al-Qur’ān, 22:78
 al-Qur’ān, 2:220
 al-Qur’ān, 2:185
 al-Bukhāri and Muslim, on the authority of Abu Hurayrah; https://sunnah.com/mishkat:1246
 al-Qur’ān, 2:184
 al-Bukhāri, on the authority of Abu Hurayrah; https://sunnah.com/riyadussalihin:1242
 al-Qur’ān, 2:198
 al-Bukhāri and Muslim, on the authority of ‘Abdullah Ibn ‘Amr
 al-Qur’ān, 16:115
 I’lām al-Muwaqqi’īn