I think the only way to get rid of guilt is to confess it, even better, talk about it with someone. Lieing to yourself will get you nowhere.
This depends entirely on how moral you are.
For some people it may not work but most people can convince themselves that it was either something they had to do, wasn't their fault or would have happened anyway.
EDIT: A favorite self lie I see used all the time is some form or "destiny", in this case you basically shift the blame to god.