Forgiveness is an essential part of reducing our attachments to the world and increasing our alignment with it.
When directed toward others, forgiveness is the process of ceasing to feel resentment or anger for a perceived offense, and ceasing to demand punishment or restitution. When we forgive someone we reduce the separation and attachment that is caused by our feelings of hurt. Those feelings are what bind us to the other person, and this is precisely the sort of attachment that causes suffering. Anger and resentment are terribly hard on the body's endocine system, especially if we nurse a grudge over a long period of time. In that case the suffering caused by the attachment can even be severe enough to cause physical illness.
Forgiving ourselves is slightly different. As we mature and gain perspective on our lives, we may come to feel that we have committed a wrong against someone else. Our feelings of shame and self-judgment for this can be very strong. If the wronged party is not available, we may not be able to ease our emotional burden by apologizing to them directly. In that case it may be useful to formally forgive ourselves, perhaps in the presence of someone we trust, in order to make the act of forgiveness more real. We might speak the forgiveness out loud, or write ourselves a letter. Doing this can remove what otherwise would be a serious barrier on our journey to trust, love and acceptance. It's important to remember that even though the person we feel we wronged may not have perceived any offense, the important matter is our own judgement of ourselves. The feeling of having wronged someone can be every bit as strong whether the offense was real or imagined.
No matter whether we are forgiving ourselves or others, one crucial thing to remember is that the event for which we are seeking or offering forgiveness is in the past. We cannot reach back and change history, in the same way that we cannot reach into the future to arrange a desired outcome. All that is available to any of us us is the present moment. The act of requesting or granting forgiveness is always for our benefit right now. What we really seek though these actions is a change in the way we feel right now, and a change in how well we are attuned to the world right now.
Called "emptying out" in personal development circles, forgiveness processes are very powerful tools for quieting the inner voices that constantly judge our behaviour (and always seem to find it wanting). When those voices are quieted, we can continue our journey in peace.