Guilt is the feeling we use to punish ourselves when our actions don't match our image of how we ourselves should be.

It can be avoided by changing our patterns of action to more closely match our view of ourselves or by changing the image whe have of ourselves to be more realistic with regards to our actions.