Guilt and shame can only come out of two sources: Fear of being rejected or excluded, or a signal that you broke your own principles.
Therefore, accept the feeling of guilt and shame. Let these emotions alert you to the fact that you either did something you yourself deem as wrong (you broke your own principles), or that you are afraid of something, and that fear is disguising itself as these emotions.
Let the emotions of guilt and shame trigger an investigation of your inner workings. Feel the emotion, and try to understand their roots. Do not escape from these emotions – they are your guiding light towards self-improvement, and self-actualizatation – to reaching your full potential – to living your life in alignment with truth and your own principles.
If you discover that you are ashamed or feel guilty because you did something wrong – you broke your own principles – then you need to make it right. Accept your fault, apologize to whoever you betrayed, and make it right again. Accept the consequences. If you let the fear of the consequences control you, your guilt and shame will create a hole inside of you that you will never be able to visit. Time may disguise that hole with dust covering it so that it is no longer visible, but it will always be there. Anytime you risk getting near it, you will feel unfree – you will not be able to let your thoghts wander in that direction.
It is only through accepting your guilt that you can make it right, and that you can live with full freedom once again.
If you discovered that the guilt or shame does not come from within, but from without, that means you are afraid of having disappointed someone else to the extend that they risk excluding you from their circle, to a degree. If that is the case, you should not let the fear disguise itself as guilt or shame. Look at that fear head on – and determine if you will stand by what you did and risk the consequence of being excluded, or if you deem it not worth it.
There is not right choice here. As long as you live truthfully – accepting that consequence as the decision making criteria for what you do next, you are making a choice based on reality. But if you do not recognize that that is the real driving force behind your guilt or shame, you will not be able to make the right choice – or at least not for the right reasons.
Therefore, face the fear of being excluded, and determine if what you did or are about to do is worth that. If it is, go ahead, and handle the consequences. If it is not worth it, you have at least made a conscious choice that you will not risk that relationship, and that at least makes clear what your priorities are, and you can be happy with your choice because you chose it consciously, based on real reasons, and your real values, rather than letting unrecognized feelings of fear disguised as shame and guilt drive your decisions unconsiously – making you forever resentful and unable to revisit that hole in your consciousness again.
To summarize: your guilt and shame can only come from two sources. Either breaking your own principles, or fear of exclusion.
If it is breaking your own principles, you need to apologize, repair and accept the consequences.
If it is fear of exclusion, you need to see through the guilt and shame and discover the underlying fear that is actually driving these emotions. Then you need to face that fear, and determine if what you did or are about to do is worth it with that fear in mind.