How to deal with regret and shame

I have been working on the overeating class and reducing buffering with food, wine, etc. One thing that keeps coming up in my homework is the overwhelming amount of shame and regret I have because I had an affair. In doing my thought work, I know I strayed because in my mind, it was a way to feel better, avoid the challenges of my life, marriage, financial issues etc. I beat myself up over this still and I don’t know how to forgive myself. I’d love some help with this.
c: affair
t: I am a horrible, weak, and selfish person
f: shame, regret
a: buffer, ruminate, beat myself up, avoid showing up and serving
r: I stay stuck in shame, regret, the past
c: affair
t: I can’t forgive myself
f: sad
a: cry, beat myself up, spin in shame and regret, avoid putting myself out there/showing up
r: I don’t forgive myself and stay stuck in the cycle
c: affair
t: I ruined everything and it’s all my fault
f: ashamed
a: beat myself up, buffer, stay stuck, don’t take action in my business, stay hidden
r: Continue to ruin things and not make the changes I want to make

c: affair
t: It is possible to get perspective and help on this situation
f: hopeful
a: reach out for help, look at my thoughts around this and understand why I made that choice at the time, get support
r: Start to shift things and move forward