The literal meaning is “to be cruel to oneself and to abandon oneself.” The two parts, 自暴 and 自弃, work together to paint a picture of someone who is not only passively giving up but is actively harming their own prospects through neglect and recklessness.