Prostrations of forgetfullness
When to Perform it
The prostration of forgetfulness is performed immediately before the closing salams of the prayer. If one does close the prayer with salams, one is no longer entitled to perform it unless one satisfies three conditions:
1. That one utter the salams having forgotten the need to prostrate;
2. That one prostrate shortly after salams; and
3. That the prayer not be invalidated by anything, such as losing one's wudu, becoming affected by filth, or turning away from the qibla for a long period of time.
Additionally, if, after salams, one merely intends not to prostrate, one is not entitled to do so if one changes one's mind later.
How to Perform it
One prostrates twice, like the prostrations of prayer. One says in them what one says while prostrating for prayer. The Arabic, transliteration, and translation of these supplications can be found in Reliance of the Traveller, Maqasid, and other books. Additionally, some scholars encourage one to say subhan-alladhee la yas-hu wa la yanam (Glorified is the One Who doesn't forget or sleep)
سبحان الذي لا يسهو و لا ينام
if the cause of the prostration is forgetfulness. If the cause of prostration is an intentional lapse, one is encouraged to ask Allah's forgiveness during the prostration.
Allah the Exalted knows best.