When someone is on a verge of losing a rule or principle that he or she has defined by himself for him or her then a guilt conscious works. I happens with those people who are close to their religious obligation and fear about God Almighty. They feel a sense of crime at every time when they feel obsessed with worldly or carnal desires. They are definitely dissatisfied and feel uncomfortable with what has happened.
The most important thing is to be realistic and self-explanatory to yourself. If you have done something that is a SIN or a Crime in other senses then you feel an urge to ask for forgiveness. Suppose if we hurt someone, even with our attitude then we feel sorry for being that harsh or to show off our that side of personality that is not dominating us in regular life.
Then the Guilt starts working and it is good that it stops us from doing great danger and harms to ourselves and to others around. Now you may ask me that you feel guilt of doing so many things but you don’t know how to overcome that feeling, and to stop yourself from behaving in that way. But you need to have a clear conviction, and to give yourself Self Statements like you are a good person and that always love to perform goof for others. Trust me it will work on drastic level.
If you feel like you have done a very serious sin and you have a religious path to follow. Then ask for forgiveness to God Almighty, and then turn to work for good things so that dark mark on your heart and soul must wipe away. It is clear that a repentance and a determination and motivation to do everything positive in future will end up a peace of mind and soul, and it will eventually lead your way to spiritual elevation.
If you get a chance to meet mystic people they are content and they have fight the evil instincts long before reaching to a position in Spirituality. I have observed that people who are good to others are actually satisfied with themselves. Guilt eventually leads to depression and at more advanced levels to neurotic disorders which might instigate one to do Suicide as well!
It also involves an approach to leave everything behind, and to forgive yourself for a mistake, and to call for forgiveness from that human being, and then eventually end up with a surrender to Divine Authority to stop yourself from doing it again. Believe me that you will feel a heavenly peace within when you really do it for sure.