Whenever I pray, I get waswasa whether I have done a particular part of namaz for example I forget if I have done rakuh or have done Salam at the end of my prayer. Please help me as it is a torture for me.
This problem is not new. I had to deal with it too, and I have found the solution: prostration of forgetfulness. However, I fear I might explain it wrong, so here is a video that explains it: https://www.youtube.com/watch?v=FJ9AvbNwT-4
Also, some hadith:
**It was narrated from ‘Alqamah that Ibn Mas’ud prostrated twice for the prostrations of forgetfulness after the Salam, and he mentioned that the Prophet (ﷺ) did that.” حَدَّثَنَا أَبُو بَكْرِ بْنُ خَلاَّدٍ، حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنْ مَنْصُورٍ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، أَنَّ ابْنَ مَسْعُودٍ، سَجَدَ سَجْدَتَىِ السَّهْوِ بَعْدَ السَّلاَمِ وَذَكَرَ أَنَّ النَّبِيَّ ـ صلى الله عليه وسلم ـ فَعَلَ ذَلِكَ . Grade
: Sahih (Darussalam)
It was narrated that ‘Abdullah said: “The Messenger of Allah (ﷺ) prayed, and he added or omitted something.” (One of the narrators) Ibrahim said: “The confusion stems from me (i.e., he was not sure which it was).” “It was said to him: ‘O Messenger of Allah! Has something been added to the prayer?’ He said: ‘I am only human, I forget just as you forget. If anyone forgets, let him perform two prostrations when he is sitting (at the end).’ Then the Prophet (ﷺ) turned and prostrated twice.” حَدَّثَنَا عَبْدُ اللَّهِ بْنُ عَامِرِ بْنِ زُرَارَةَ، حَدَّثَنَا عَلِيُّ بْنُ مُسْهِرٍ، عَنِ الأَعْمَشِ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، عَنْ عَبْدِ اللَّهِ، قَالَ صَلَّى رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ فَزَادَ أَوْ نَقَصَ - قَالَ إِبْرَاهِيمُ وَالْوَهْمُ مِنِّي - فَقِيلَ لَهُ يَا رَسُولَ اللَّهِ أَزِيدَ فِي الصَّلاَةِ شَىْءٌ قَالَ " إِنَّمَا أَنَا بَشَرٌ أَنْسَى كَمَا تَنْسَوْنَ فَإِذَا نَسِيَ أَحَدُكُمْ فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ " . ثُمَّ تَحَوَّلَ النَّبِيُّ ـ صلى الله عليه وسلم ـ فَسَجَدَ سَجْدَتَيْنِ . Grade
: Sahih (Darussalam)
It was narrated that Ibrahim said: "Alqamah prayed five (rak'ahs) and when he said the taslim, Ibrahim bin Suwaid said : 'O Abu Shibl, you prayed five!' He said: 'Is that true, O odd-eyed one?' Then he prostrated two prostrations of forgetfulness, then he said: 'This is what the Messenger of Allah (ﷺ) did.'" أَخْبَرَنَا سُوَيْدُ بْنُ نَصْرٍ، قَالَ أَنْبَأَنَا عَبْدُ اللَّهِ، عَنْ سُفْيَانَ، عَنِ الْحَسَنِ بْنِ عُبَيْدِ اللَّهِ، عَنْ إِبْرَاهِيمَ، أَنَّ عَلْقَمَةَ، صَلَّى خَمْسًا فَلَمَّا سَلَّمَ قَالَ إِبْرَاهِيمُ بْنُ سُوَيْدٍ يَا أَبَا شِبْلٍ صَلَّيْتَ خَمْسًا . فَقَالَ أَكَذَلِكَ يَا أَعْوَرُ فَسَجَدَ سَجْدَتَىِ السَّهْوِ ثُمَّ قَالَ هَكَذَا فَعَلَ رَسُولُ اللَّهِ صلى الله عليه وسلم . Grade : Sahih (Darussalam)strong text**
If you cannot discern where you have prayed 3 or 4 rakahs, you know that you've prayed at least 3 so go with that and then do sujood as sahw before salam.
The evidence for my statement:
Abu Sa’eed Al-Khudri, may Allaah be pleased with him, in which he said: the Prophet (peace be upon him) said, "If any of you doubts during his prayer and he does not know how many [raka’aat] he has prayed, whether it is three or four, then he should discard and cast away his doubt. He is to continue upon what one is sure of [i.e. the lesser] then perform two prostrations before making tasleem. If he ends up [in reality] praying five [raka’aat], then his prayer will be an intercession for him; and if he ends up completely the [requisite] four [raka’aat] then it is targheeman for shaytaan."*
Sahih Muslim 5/60