Guilt has its purpose. When it is fulfilling its purpose it is our response to the Holy Spirit's conviction. When we feel this we are to go to God, give it and our sin to Him and let Him restore us so we then can again live for Him and have fellowship with Him and others.
Yet, guilt is often misused by us and others. Why? Because pride and manipulation and human judgment get mixed in with it.
How?
Pride:
Let's say you did something wrong to your spouse. You get caught. You feel guilty. You ask for forgiveness. Your spouse forgives you and let's it go. But you keep hold of the guilt because you think you shouldn't have messed up. You think you need to punish yourself a bit more. This is the result of pride -- all it does is get between you and your spouse (or whoever the other person is) and God. You can't hvae a working relationship with anyone if you keep hold of guilt.
Manipulation:
You sin and someone else uses it to get you to do things. They use your guilt to control you. Maybe they say they are going to expose your actions. Maybe they bring it back over and over and say how much you hurt them -- this too is very bad manipulation. If you have truly repented and sought forgiveness, then there is no need to let them do this to you. You are clean in God's eyes. You can make amends but in the right Spirit willingly -- not being forced to by a third party.
Human Judgment:
This one is easy to understand. Someone knows your mistake and judges you for it. When this happens you need to pray for that person and realize it doesn't matter what that person thinks of you. Often we try to please others, try to get them to see us in a good light, but this doesn't work. They are going to think what they want no matter what you do. Don't explain yourself. If you are right with God and the other one involved it is done. Move on. If others don't, that is between them and God.