Question about TPS and immigration?

can an illegal immigrant who lived here before a TPS was granted for their country, apply and be granted a TPS or do they need certain immigration status.

also, what if an illegal immigrant wanted to leave the country and go back to their country of origin?
what will happen?
Update: they cant just leave right?
3 answers 3