What I mean when I use a self-anecdote to comfort someone: You’re not alone in your experiences and your feelings are real and valid.
What it sounds like:
One of the best ways I’ve found to deal with this (I’ve been on both sides) is to just ask your friend at some point if this is something that makes them feel better or not. Asking “If I talk about similar thing happening in my life, does that make you feel better or worse when you’re upset?”. Best to ask when they aren’t actively upset, just some other time. If might seem awkward but I appreciated it when my friends did it and it was well received when I asked it.