If you petition has not been approved and no visa has been issued, then you can withdraw a petition for an immigrant or non-immigrant visa. That means that up until your fiance, spouse, or other relative is issued a visa to the US you can request to withdraw the petition. In other words, if you divorce your spouse before the CR-1/IR-1 visa is issued you can withdraw your application.
You can also withdraw applications for adjustment of status. This applies for people who are adjusting from non-immigrant K-1 and K-3 visas and people who are currently in the US illegally or with some other type of visa.
There are cases where an immigrant can still obtain legal status even if you withdraw your support, especially in cases of domestic violence.
Can I withdraw my affidavit of support?
Most likely no. Affidavits of support are valid for 10 years, until the immigrant aquires citizenship, or acquires 40 qualifying periods of employment. So, if you were a co-sponsor or sponsor and no longer wish to be the sponsor for the affidavit of support you probably will not be allowed to withdraw your affidavit. That is why you should be careful about agreeing to sponsor an immigrant.
How do I withdraw my petition?
If the case is not yet finally approved you can send a letter either to the USCIS office where you filed the petition or to the consulate (if you already have an initial approval) stating that you want to withdraw the petition. You should also send a copy of the receipt notice.
Do not withdraw the case lightly based on an argument with your spouse, fiance, or other relative. There is no reinstatement and no appeal. So, if you change your mind you have to pay all of the fees again and start the process from the beginning.
If you want to withdraw support for a person already in the US, you may want to consult my guide on immigration fraud.