How does a married immigrant get divorced and marry someone else?

An immigrant gets divorced and remarried in the same manner that anyone does: by filing a divorce in the appropriate Court and following the Court process to obtain a decree of divorce, and then by having the marriage performed by someone authorized to do so.