The first thing to do is hire an immigration attorney experienced with the consequences of criminal convictions.
Not all immigration attorneys handle cases concerning aliens with criminal convictions. Even within the specialty of immigration law, there are attorneys who specialize in representing non U.S. citizens with criminal issues. Your immigration attorney and criminal defense attorney will work together to minimize the immigration consequences of your conviction.
If I am being charged with a misdemeanor am I safe from deportation?
Whether you are undocumented or already a legal resident being charged with even a misdemeanor crime could have serious immigration consequences. For example, if you have been a legal permanent resident for less than 5 years and have a conviction for shoplifting you could be charged as removable from the United States. In many states, the maximum possible sentence for a misdemeanor is 365 days. If the crime is one involving moral turpitude (this determination requires legal analysis) and the maximum possible sentence is 365 days or more the non-citizen may find themselves removable or ineligible for certain forms of relief from deportation, such as cancellation of removal,
What if I get diversion or a suspended sentence?
In terms of immigration law, even if your conviction is later dismissed pursuant to a diversion or rehabilitative program it may still count against you. Each state has different programs to help those charges with minor crimes eventually come out of the system with a "clean" criminal record. For the non-citizen only a handful of those programs will not result in a conviction for immigration purposes. Likewise if the Judge orders a 365 jail sentence and suspends 364, for immigration purposes you will have been sentenced to a year or more in jail. If the conviction is for an offense that can be defined as a crime of violence and there is sentence of a year or more it could be an aggravated felony. Having an aggravated felony presents extremely serious immigration consequences and should be avoided at all costs.
The District Attorney has offered me a deal to plead guilty to "attempted"..... (insert crime)
In terms of the consequences for immigration law, an attempt to commit a crime, is no less a problem for the non-citizen as having actually committed the crime. (there are a few narrow exceptions)
If you have been charged or convicted with a crime beware of travel abroad.
Beware of even short trips outside the United States, because every time the non-citizen presents their green card at customs they are really asking to be admitted into the United States. While some crimes may not qualify as a basis for placing the non-citizen into removal proceedings, it may be the basis to deny admission back into the United States.