Quran Verses and Hadiths on Thoughts and Intention in Islam

لِّلَّهِ مَا فِى ٱلسَّمَٰوَٰتِ وَمَا فِى ٱلْأَرْضِ ۗ وَإِن تُبْدُوا۟ مَا فِىٓ أَنفُسِكُمْ أَوْ تُخْفُوهُ يُحَاسِبْكُم بِهِ ٱللَّهُ ۖ فَيَغْفِرُ لِمَن يَشَآءُ وَيُعَذِّبُ مَن يَشَآءُ ۗ وَٱللَّهُ عَلَىٰ كُلِّ شَىْءٍ قَدِيرٌ

To Allah belongs whatever is in the heavens and whatever is in the earth. Whether you show what is within yourselves or conceal it, Allah will bring you to account for it. Then He will forgive whom He wills and punish whom He wills, and Allah is over all things competent.

 This verse indicates that Allah knows what is in the hearts and minds of His servants, and He will judge them according to their intentions and thoughts. 

‘Abdullāh ibn ‘Abbās (may Allah be pleased with him) reported that the Messenger (may Allah's peace and blessings be upon him) said:

 "Allah has written down the good deeds and the bad ones. Then He explained it [by saying that] he who has intended a good deed and has not done it, Allah writes it down with Himself as a full good deed, but if he has intended it and has done it, Allah writes it down with Himself as from ten good deeds to seven hundred times, or many times over. But if he has intended a bad deed and has not done it, Allah writes it down with Himself as a full good deed, but if he has intended it and has done it, Allah writes it down as one bad deed."   

Therefore, one should always seek refuge in Allah from evil thoughts and try to replace them with good ones.

وَلَا تَقْفُ مَا لَيْسَ لَكَ بِهِۦ عِلْمٌ ۚ إِنَّ ٱلسَّمْعَ وَٱلْبَصَرَ وَٱلْفُؤَادَ كُلُّ أُو۟لَٰٓئِكَ كَانَ عَنْهُ مَسْـُٔولًا

Allah says (interpretation of the meaning): “And follow not (O man i.e., say not, or do not or witness not) that of which you have no knowledge. Verily! The hearing, and the sight, and the heart, of each of those ones will be questioned (by Allah)” [al-Isra’ 17:36]. 

The Prophet (peace and blessings of Allah be upon him) said: 

“Beware of suspicion, for suspicion is the worst of false tales; and do not look for others’ faults and do not spy, and do not be jealous of one another, and do not desert (cut your relation with) one another, and do not hate one another; and O Allah’s worshipers! Be brothers (as Allah has ordered you!”) (Narrated by al-Bukhari, 5144; Muslim, 2563). 

This hadith warns us against having negative thoughts about others without evidence or proof, and it also enjoins us to maintain good relations with our fellow Muslims and avoid hatred and envy. 

The Prophet (peace and blessings of Allah be upon him) said: 

“The Shaytan may come to any one of you and say: ‘Who created Allah? Who created such and such?’ If any one of you experiences that, let him say: ‘Amantu billahi wa rusulihi (I believe in Allah and His messengers),’ and that will drive him away.” (Narrated by Muslim, 134). 

This hadith teaches us how to deal with the whispers of the Shaytan that may cause doubt or confusion in our minds, by seeking refuge in Allah and affirming our faith in Him and His messengers.