Sujud as-sahw, the prostration of forgetfulness, is a pair of extra prostrations that a worshipper makes to correct a mistake in the prayer. It is used when something is forgotten, when something extra is added, or when a person is unsure how many units, or rak'ahs, they have prayed. It exists because even the Prophet, peace be upon him, was a human being, and the reports show how he corrected his own mistakes. In one report, the Prophet stood up after the second rak'ah of the Zuhr prayer without sitting. When the prayer was nearly over, he said the takbir and prostrated twice before ending the prayer with the salam. This is recorded in Sahih al-Bukhari, number eight hundred and twenty-nine. In another report, he finished a prayer after only two rak'ahs. A companion called Dhul-Yadayn asked whether the prayer had been shortened, or whether he had forgotten. After confirming with the others, the Prophet completed the remaining rak'ahs, said the salam, and then made two prostrations. That is in Sahih al-Bukhari, number twelve hundred and twenty-eight. And for a person unsure whether they have prayed three or four rak'ahs, a report in Sahih Muslim, number five hundred and seventy-one, says to set the doubt aside, build on what you are sure of, and make two prostrations before the salam. In outline, the correction is made by saying the takbir and performing two prostrations like ordinary ones, then finishing the prayer. It is most often connected with three situations: leaving out a part of the prayer, adding an extra part, and doubt about the count. Scholars differ on one well-known detail: whether the two prostrations come before or after the final salam, partly because different reports describe each. In outline, the Hanafi school generally places them after the salam, and the Shafi'i school before it. The Maliki school distinguishes between leaving something out, before, and adding something, after. The Hanbali school generally follows the placement given in each report. All agree that the prostrations themselves are prescribed. Which mistakes are covered in this way, and which require the missed part itself to be prayed, also depends on the school. Follow your school, or ask a knowledgeable local teacher about your case. The reports also show the right attitude. The correction is simple and calm. It is a mercy built into the prayer, not a reason for anxiety. And if doubts come again and again and become distressing, speak to a trusted teacher, rather than repeating your prayers over and over.