Growing self awareness combined with self compassion seems to be the key.
Where before those memories of moments I could have handled differently would make me judge and berate myself, now I try to see them as useful information for how to recognise what's going on next time I'm in a similar situation.
I think that before I understood the cause of my distress, I coped with it by ignoring and suppressing it. Now that I understand more, it's easier to recognise what's going on and take appropriate action.
Not always possible, and I still fall back into earlier habits quite often.