This is a very complex question that cannot be answered completely in a few lines. It depends on where you are in the immigration process. If you have an adjustment of status case pending, a divorce will almost certainly result in the denial of your application. You may be able to file an abused spouse petition and still get the green card. If you have a two-year green card, you will need a divorce waiver to remove the conditions. A divorce poses less risk to a ten-year green card holder.