If you've completed you salaah and realized you've added a rakaah, then you just say Allahu Akbar and go into 2 prostrations of forgetfulness.
If there has been a long gap between your salaah and what you've realized, then repeat the prayer.
Allah knows best.