It is good that you are recognizing what is going on. You cannot change a behavior until you can "see" it. Try to catch yourself putting yourself down and then counter it with a self-supportive thought or idea and as you get better at doing that, you won't need to put yourself down so much, won't need to rely on others telling you you are okay.
When I would catch myself saying something self-deprecating, I would just think "Support!" and see three little men in togas carry in a Corinthian column to the middle of my head and set it up and then trundle off toward the other ear

It was so funny I learned to laugh at myself and enjoy my imagination while I was putting down my negative comment habit. Make self support more fun/enjoyable than the iffy rewards of getting others to say nice things about you that you probably won't believe anyway?