I really wanted to know that what to do when you aren't sure whether you commited a sin or not? In my case while watching a match, a really bad thought came in my mind about Islam out of nowhere, is this a sin?
In fact, thinking about something bad is not considered a sin. God(allah) only holds the servant accountable for his actions, and not for what he thinks. As mentioned in quran
(۞ وَمَاۤ أُبَرِّئُ نَفۡسِیۤۚ إِنَّ ٱلنَّفۡسَ لَأَمَّارَةُۢ بِٱلسُّوۤءِ إِلَّا مَا رَحِمَ رَبِّیۤۚ إِنَّ رَبِّی غَفُورࣱ رَّحِیمࣱ) [سورة يوسف 53]
(I do not pretend to be blameless, for man’s very soul incites him to evil unless my Lord shows mercy: He is most forgiving, most merciful.’)
Wama obarri-o nafsee inna annafsalaammaratun bissoo-i illa ma rahimarabbee inna rabbee ghafoorun raheem
yufuf aya 53.
And the same thing happened with the companions of Muhammad, may God bless him and grant him peace When God revealed this verse to His Messenger, the Companions said: We have been patient with prayer, zakat, and Hajj, so how can we be patient with what we cannot handle?
(لِّلَّهِ مَا فِی ٱلسَّمَـٰوَ ٰتِ وَمَا فِی ٱلۡأَرۡضِۗ وَإِن تُبۡدُوا۟ مَا فِیۤ أَنفُسِكُمۡ أَوۡ تُخۡفُوهُ یُحَاسِبۡكُم بِهِ ٱللَّهُۖ فَیَغۡفِرُ لِمَن یَشَاۤءُ وَیُعَذِّبُ مَن یَشَاۤءُۗ وَٱللَّهُ عَلَىٰ كُلِّ شَیۡءࣲ قَدِیرٌ) [سورة البقرة 284]
Whatever is in the heavens and in the earth belongs to God and, whether you reveal or conceal your thoughts, God will call you to account for them. He will forgive whoever He will and punish whoever He will: He has power over all things.
Lillahi ma fee assamawatiwama fee al-ardi wa-in tubdoo ma feeanfusikum aw tukhfoohu yuhasibkum bihi Allahufayaghfiru liman yashao wayuAAaththibu man yashaowallahu AAala kulli shay-in qadeer
Surah baqarah verse 284
After Muhammad, may God’s prayers and peace be upon him, commanded them not to be like those who preceded them from the People of the Book, and to say, “We believe and we obey.”
God revealed again to Muhammad, may God’s prayers and peace be upon him, and eased them, and God Almighty said in his book, complementing the verse before it.
(لَا یُكَلِّفُ ٱللَّهُ نَفۡسًا إِلَّا وُسۡعَهَاۚ لَهَا مَا كَسَبَتۡ وَعَلَیۡهَا مَا ٱكۡتَسَبَتۡۗ رَبَّنَا لَا تُؤَاخِذۡنَاۤ إِن نَّسِینَاۤ أَوۡ أَخۡطَأۡنَاۚ رَبَّنَا وَلَا تَحۡمِلۡ عَلَیۡنَاۤ إِصۡرࣰا كَمَا حَمَلۡتَهُۥ عَلَى ٱلَّذِینَ مِن قَبۡلِنَاۚ رَبَّنَا وَلَا تُحَمِّلۡنَا مَا لَا طَاقَةَ لَنَا بِهِۦۖ وَٱعۡفُ عَنَّا وَٱغۡفِرۡ لَنَا وَٱرۡحَمۡنَاۤۚ أَنتَ مَوۡلَىٰنَا فَٱنصُرۡنَا عَلَى ٱلۡقَوۡمِ ٱلۡكَـٰفِرِینَ) [سورة البقرة 286]
God does not burden any soul with more than it can bear: each gains whatever good it has done, and suffers its bad- ‘ Lord, do not take us to task if we forget or make mistakes. Lord, do not burden us as You burdened those before us. Lord, do not burden us with more than we have strength to bear. Pardon us, forgive us, and have mercy on us. You are our Protector, so help us against the disbelievers.’
La yukallifu Allahu nafsanilla wusAAaha laha ma kasabatwaAAalayha ma iktasabat rabbana latu-akhithna in naseena aw akhta/narabbana wala tahmil AAalayna isrankama hamaltahu AAala allatheena minqablina rabbana wala tuhammilnama la taqata lana bihi waAAfuAAanna waghfir lana warhamnaanta mawlana fansurna AAalaalqawmi alkafireen
Surah baqarah last verse
In conclusion, I am not an islamic schooler and I have tried to answer you as much as possible And I make du-ah to allah that He forgives us our past and future sins