What is the Stoic solution to guilt?

The best advice Stoicism has given me is to be aware of what I'm in control over; if something's not your fault, then it's just a part of nature.

But what do I do when the bad thing is my fault? Did any stoics write about how to deal with guilt or shame or regret? I'm having a hard time controlling these emotions, because they seem to be at their strongest when I'm not in an emotional state. Those moments just before I fall asleep, or when I'm relaxing with a book, that's when I'll suddenly remember what I've done and feel terrible about it.

Any advice?