An annulment is the cancellation of a marriage based on its being declared invalid from the beginning. When one gets an annulment, the law will treat the marriage as if it had never existed, because legally, it didn't.
Valid bases for an annulment in California include: one or both spouses were underaged (under 18) and did not have valid written approval from a parent and a valid court order permitting it, the marriage was conducted by force or by fraud/deceit, if a spouse was of unsound mind at the time of marriage, or if a spouse has an "incurable physical incapacity."
Unlike most divorces, which take 6 months before they are finalized, annulments are effective immediately. But the proper legal paperwork must be filed and the legitimate legal grounds established. Plus, there are statutes of limitations on many of the permissible grounds of annulment, such as the 4-years from 18 time limit for annulments based on underaged marriages.