Dealing with Criticism

Hi everyone,
I’ve realised that I have never really learnt how to deal with criticism or failure before. I internalise it and it grows and grows until it’s all I can think about. I have depression and it starts off a spiral every time. There are incidents of failure in my past that I think about regularly and I engage in negative self talk. My question is how do you deal with criticism? Is there a way I can stop it ruining my life?
Thank you x

@aph997
A few years ago when I was reading a book about solving conflicts, there was a sentence there like "I think at some point you might be right".
I thought it might be a good idea.
"I think at SOME point..." means someone might be partially right, but may not know or understand all the truth about you. And then you don't have to feel defensive.
"...you MIGHT be right" means there might be some valuable info in things another person wants to tell you, things you might have been not aware of, and that be some knowledge useful for your personal growth.
It is like saying: "I am a valuable person, despite the fact that I'll NEVER be spotless and I make mistakes sometimes".
Maybe a little helpful is also thinking that perfection usually does NOT belong to this world.