Two people can experience the same thing and for one it is traumatic and for the other it's not. Perhaps for your friend the statement was true, but not for you. You could as easily say to him, 'Childhood trauma causes suicide," which may be true for you, but not for him.
I try when people say things like he did to imagine they added on "for me." Like when people say, "You just have to _______," I try to reframe it as them saying for themselves, "I just have to ______." Otherwise, I fight with the feeling of being offended and wanting to reject/shove off what I feel Iike they're trying to put on me, and that reaction also comes from trauma. And honestly, that coping skill is a cognitive thing but it hasn't conquered the issue for me, it just gives me some distance.
Some people have boundaries such that those kinds of statements ping right off of them (what your friend said or "you just have to"), but I think sometimes it's not a true boundary but unawareness, like your friend is unaware of your pain and it's pinging right off, so when it's brought into their awareness, they make a negating or minimizing statement rather than having compassion for where the other person is coming from, really hearing them and seeing them. Then it's not a boundary, it's armor, and the armor keeps them from being aware. They feel safe, we feel like crap.
What does calm me down just a little bit is talking it out like I am here and recognizing I've done that, too. But I don't know how to recognize that in the moment. If I could, I'd be better able to shrug it off rather than wanting to shove it off. And sometimes when I remember something like that someone said, I want to shove it off all over again, even though I know it's something to shrug off. That's a bit of PTSD I'm experiencing which is causing me to feel like big things are being put on me and keep coming back.