The perceived function of guilt, like pain, is an impulse to get rid of the unpleasant sensation. Underlying that, however, is the more significant purpose of dealing with the root cause. In the long run it won't help you to try to purge authentic guilt feelings unless you let them guide you toward forgiveness and reconciliation. Guilt by itself doesn't lead you anywhere, just as pain does not; both are directional, symptoms of a condition that requires your urgent attention.
Painting ~ Amarilla 1879, Frederick Leighton 1830-1896
Wikimedia Commons public domain