Annulments are the way to go, under some conditions.

The "defect" must have been present before the supposed marriage.

A marries B, but was previously married to C.
A marries B, but was not of age/sound mind/sober
A marries B, but B in no sense was open to children.

These are pre-existing defects.

A marries B, and "falls out of love"....marriage remains.
A marries B, but B has an affair after the marriage....marriage remains.