Guilt is an emotion that arises in response to violating one's own moral code, leading to a sense of self-punishment.