السلام عليكم ورحمة الله وبركاته أحسن الله إليكم What should a person do if, while reciting a surah in salah by themselves, they forget an ayah and cannot remember it?

Ustadh AbdulAziz al-Haqqan
If the forgotten ayah belongs to the surah recited after al-Fātiḥah — which is the predominant form of your question — then the prayer is valid and there is nothing required of him. He has the choice between bowing into rukūʿ, moving on to what follows the ayah, or moving to another ayah or surah altogether; for reciting an additional surah is a Sunnah, not a pillar (rukn).