Deportation or Removal
For a variety of reasons, both green card holders and those in the United States illegally end up in Immigration Court. Generally, before almost anyone is deported or removed from the United States, they have a right to be heard in Immigration Court. There are exceptions and the person to be deported/removed may have to remain detained while awaiting their hearing, but almost everyone is entitled to a hearing. At that hearing, the Immigration Judge will tell the person facing deportation/removal that they have the right to an attorney but that the government will not pay for it.
Those persons should contact an immigration attorney to find out if they have any relief available to them; in other words, is there a way that they can stay in the United States legally. If the Immigration Judge orders someone deported or removed, then that person will have a more difficult time getting their green card in the future even if they have a way to do it, for example, if they marry a US citizen. Since these hearing have serious consequences, people should at least meet with an experienced immigration attorney to find out about their rights and to find out if there is any way that they can legalize their status in the United States. Also, if the person is detained, you should contact an immigration attorney to find out if they are eligible to be released from detention and have their hearings while they are out on bond/bail.