Next time the voice in your head tells you that you are worthless, don't judge it and try not to react emotionally. Just notice it and then substitute a positive statement or affirmation about yourself.
Telling yourself you are worthless is a mental habit you've built up over time, so you aren't going to extinguish it overnight. But if you keep doing this, it will slowly diminish.
I AM worthy. I have TREMENDOUS worth and value. I love myself UNCONDITIONALLY, etc.
This might help -
https://www.happierhuman.com/affirmations-self-worth/
P.S. Have you thought about therapy?