Sujud Sahwi

Sujud Sahwi or Sajdah of forgetfulness occurs during the ritual salat prayer. Out of forgetfulness a person can either omit obligatory parts of salat (Qabli) or add to the salat (Ba'adi). In either cases the person corrects his/her salat by doing the Sujud Sahwi.

Types
Prophet Muhammad has detailed in the hadith what must be done in the case of a worshipper adding or subtracting something from their salat due to forgetfulness.

Qabli (omitting from the prayer out of forgetfulness)
Before making the tasleem (i.e. saying as-Salaam ‘Alaikum on both sides) the person must say the takbir (i.e. Allāhu Akbar) while sitting and then make two prostrations as per normal sujud. Then the tasleem is made.

Ba'adi (adding to the prayer out of forgetfulness)
After making the tasleem the person must stay seated and say the takbir while sitting and then make two prostrations. Then the tasleem is made again.

When one has doubt as to whether added or subtracted from the prayer
The person must first build upon what is certain of by using the lowest of the possible choices; e.g. if a person is unsure whether they prayed three or four raka’aats for Zuhr prayer (which has four raka’aats), then he/she must take the lower option of three and pray one more raka’ah. Then one should do two prostrations before making taslim.

Taharr
Taharr is when one has doubt as to whether they added or subtracted from their prayer, but then realise what they did wrong.

The person should complete their salat with tasleem and then prostrate twice. They should then make the tasleem.