"Wash me thoroughly from my iniquity, and cleanse me from my sin. For I know my transgressions, and my sin is ever before me." Psalms 51:2-3
We all need to be free from guilt, for it saps us physically, emotionally, and spiritually. When it comes to guilt, the best way to avoid it is simply to do what is right.
When we don't, we first need to confess your sin to God with a genuine desire to get things right. I promise that when you pursue the forgiveness of God through Jesus Christ, with an attitude of seeking to get things right, it will free you of guilt. He wipes the slate clean.
Second, seek forgiveness from those you have wronged. Make restitution.
Third, forgive yourself. Many people struggle with this, but we should recognize that when God has forgiven us, we can forgive ourselves.
Fourth, don't confuse forgiveness with the removal of consequences. God forgives immediately, but we have to deal with the consequences of our sin.
The good news is that we can be free of guilt when we seek to get things right -- God's way.