What Are the Sources of Waswas?
Question

I'd like to know if there is a way to distinguish the waswasah (insinuating whispers) that is coming from the Shaytan, and the waswasah coming from the nafs (soul), and can we know which is coming out of which? And if it is coming out of the nafs, are we going to be held accountable, even if we reject it?
Praise be to Allah.Sources of Waswas
The waswas which people experience are not all of the same type or degree, either in terms of the type of sickness or in terms of its source and effect. 
The kind of waswas which tempts a person to listen to or look at haram (unlawful) things or to commit immoral actions, and makes such things appear attractive to him, comes from three sources: the nafs (or self), which is inclined to evil, the devils among the jinn (demons), and the devils among mankind. 
Allah says, describing the first source, which is the nafs (interpretation of the meaning):  
“And We have already created man and know what his soul whispers to him, and We are closer to him than [his] jugular vein” (Qaf 50:16)
Allah says, describing the second source, which is the devils among the jinn (interpretation of the meaning): 
Then Satan whispered to him; he said, "O Adam, shall I direct you to the tree of eternity and possession that will not deteriorate?" (Ta-Ha 20:120)
And Allah says, describing the third source, which is the devils among mankind (interpretation of the meaning): 
{Say, "I seek refuge in the Lord of mankind, The Sovereign of mankind. The God of mankind, From the evil of the retreating whisperer - Who whispers [evil] into the breasts of mankind - From among the jinn and mankind."} (al-Nas 114:1-6)
So these waswas may come from the jinn or from the sons of Adam (human beings). 
Please see question no. 59931
Source of Waswas in prayer and wudu: What happens to a Muslim regarding his wudu and prayer, where he does not know how many times he washed during wudu or how many rak’ahs (units of prayer) he did in prayer, comes from the Shaytan. If he seeks refuge with Allah from the Shaytan, Allah will suffice him against him. But if he gives in to him and responds to the waswas, the Shaytan will gain power over him, and that waswas will become a chronic problem. This is what is called al-waswas al-qahri (overwhelming waswas or OCD). 
What is OCD?
This kind of waswas – as one of those who are specialized in this field said – “is a sickness which befalls some people like any other kind of sickness. It refers to repeated thoughts, movements, ideas or notions which are of a loathsome nature that a person would ordinarily reject and strive to resist. He also realizes that they are wrong and have no meaning, but there is something that is pushing him towards them and he usually fails to resist them. The strength of these waswas may vary, so much so that they appear – to non-specialists – to be very strong and it seems that the sick person is doing that willingly. This kind of waswas may also affect a person in his worship and in his worldly affairs.” 
How to dispel waswas
The waswas of the Shaytan may be dispelled by seeking refuge with Allah. 
The waswas that comes from one’s own self may also be dispelled by seeking refuge with Allah, and by strengthening the connection between a person and his Lord by doing acts of worship and obedience and by giving up evil things. 
As for al-waswas al-qahri (OCD), it is a kind of sickness as stated above. 
Difference between different types of waswas
The difference between the waswas that comes from the Shaytan and the waswas that comes from the nafs is subtle, as was quoted by Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) from some of the scholars. He said: 
“Abu Hazim made a comparison between the waswasah caused by the nafs and that caused by the Shaytan, and said: Whatever your nafs hates for your nafs is from the Shaytan, so seek refuge with Allah from it. And whatever your nafs likes for your nafs is from your nafs, so forbid it from it.” (Majmu’ al-Fatawa, 17/529, 530) 
I.e., the nafs usually whispers concerning things which are connected to its whims and desires, which people usually like. 
Some of the scholars pointed out another important difference, which is that the waswas that comes from the Shaytan makes sin appear attractive until the Muslim falls into it; if the Shaytan is unable to achieve that, he moves on to another sin, and if that does not work he moves on to a third, and so on. He does not care about making the Muslim fall into a particular sin, rather what he cares about is making the Muslim disobey his Lord, and it is all the same to him whether he makes him do something that is forbidden or omit something that is obligatory, for all of it is sin and disobedience. 
As for the waswas that comes from the nafs, it is what urges the person to commit a specific sin and repeatedly seeks to make him do it.  
Are we held accountable for waswas?
The Muslim will not be punished for the waswas that comes from the Shaytan or from his own nafs, so long as he does not speak of it or act upon it. But he is commanded to resist it, and if he neglects to resist it and gives in to it, then he will be punished for that neglect. 
He is commanded not to pay any attention to the waswas of the Shaytan, and to proceed on the basis of the smaller number (of rak’ahs) in prayer if he is not sure how many he has done. He is commanded to seek refuge from the Shaytan and spit dryly to his left three times if the waswas of the Shaytan comes to him whilst he is praying. He is commanded to keep company with good people and avoid bad people. Whoever is negligent with regard to any of these matters will fall into the traps of his nafs which is inclined to evil, or will respond to the devils among the jinn and mankind, in which case he will be held accountable. 
How to overcome OCD
As for overwhelming waswas (OCD), it is a kind of sickness – as mentioned above – so the Muslim will not be harmed by it and Allah will not hold him accountable for it, because it is beyond his control. Allah says (interpretation of the meaning): 
Allah does not charge a soul except [according to] what He has given it. (al-Talaq 65:7)
So fear Allah as much as you are able (al-Taghabun 64:16) 
And the Prophet (peace and blessings of Allah be upon him) said: “Allah will forgive my ummah (followers) for whatever crosses their minds so long as they do not speak of it or act upon it.” (Narrated by al-Bukhari, 4968; Muslim, 127)
The one who is afflicted with this kind of waswas must always read Quran and recite the dhikrs (words of remembrance) prescribed in shari’ah (Islamic law), morning and evening. He must strengthen his faith by doing acts of worship and shunning evil. He must occupy himself in seeking knowledge, for although the Shaytan may gain power over a worshipper, he cannot gain power over one who has knowledge. 
The Shaytan may come and whisper evil things to a Muslim about Allah, or His Messenger, or His shari’ah, things that the Muslim hates and does not approve of. The fact that he resists these waswas and hates them is a sign of the soundness of his faith. So he should strive to control his nafs and not respond to the one who calls him to evil. 
Ibn Kathir (may Allah have mercy on him) said: 
The phrase: Whether you show what is within yourselves or conceal it, Allah will bring you to account for it. (al-Baqarah 2:284 – interpretation of the meaning) means that even if He brings you to account and questions you, He will not punish you except for that which a person is able to ward off. As for that which he cannot ward off, such as the waswas of the nafs, no one is accountable for that, and hating evil waswasah is part of faith. (Tafsir Ibn Kathir, 1/343)
Al-Shaykh ‘Abd al-‘Aziz ibn Baz (may Allah have mercy on him) was asked: 
Waswas and ideas may cross a person’s mind, especially to do with tawhid (the oneness of Allah) and faith ; will the Muslim be held accountable for that? 
He replied: 
“It is narrated in al-Sahihayn and elsewhere that the Messenger of Allah (peace and blessings of Allah be upon him) said: “Allah will forgive my ummah (followers) for whatever crosses their minds so long as they do not speak of it or act upon it.” (Agreed upon) And it is narrated that the Sahabah (may Allah be pleased with them) asked the Prophet (peace and blessings of Allah be upon him) about the kinds of waswas and thoughts referred to in the question crossing their minds. He (peace and blessings of Allah be upon him) replied: “That is a clear sign of faith.” (Narrated by Muslim) And he (peace and blessings of Allah be upon him) said: “The people will keep on wondering until it is said, ‘This was created by Allah, but who created Allah?’ Whoever experiences any of that, let him say, Amantu Billahi wa rusulihi (I believe in Allah and His messengers).’” (Agreed upon)  According to another report: “Let him seek refuge with Allah and stop it.” (Narrated by Muslim in his Sahih) (Tuhfatal-Ikhwan bi Ajwibah Muhimmah tata’allaq bi Arkan al-Islam (question no. 10) 
And Allah knows best.