We all go through this. What helped me is studying cognitive behavioral therapy or CBT. Cognitive behavioral therapy is also known as talk therapy and it's one of the primary tools that therapists use to talk their patients out of depression. Now don't get me wrong, I'm not saying you're depressed or anything but it really helps deal with negative self talk. Here's a pdf of the book I found online.
http://islamiconlineuniversity.com/counseling/resources/David%20Burns%20-%20Feeling%20Good.pdfThe entire basis of CBT is that the way we think determines the way we feel and if we can change the way we think then we can change what we're feeling. Instead of trying to "ignore" or "silence"your thoughts like a zen buddhist you should try to replace them with thoughts that are much more productive to your well being. Keep in mind... you have to actually believe in the new thought. You can't just tell yourself "The music that I'm making is the best thing I've ever heard!" because you won't believe it unless it really is that good.
For example, lets say you were feeling doubtful about some piece of music. You might be thinking to yourself "It doesn't sound as good as X artists track and I'll never be able to be as good as them." With CBT you write the thought down on a piece of paper and then you evaluate the truth of what you're saying. Maybe it doesn't sound as good as X artists track but does that necessarily mean that you'll never be as good as them? So instead you replace the old thought with something like this...
"It's true that my music doesn't sound as good as X artists track but that doesn't mean that I'll NEVER be as good as them. They've been producing for a decade while I've only been at this for a few years. If I keep on practicing everyday then I'll keep getting better and one day I'll be just as good as "X" artist. Now why don't I try working on some sound design/mixing etc..."
I'm not saying to lie to yourself. If your music doesn't sound as good as you want it to sound then you need to be honest with yourself. That's the only way you get better. Yes your music may sound off to you now the question is "why?". What is it about your music that doesn't sound as good as "X" artist? Take it as an opportunity to learn and grow! Is it because the chord progression is to cliche? Does something in the mix just sound off? Keep on experimenting until you figure out why things sound like crap and then learn from it!
My music sounded like crap 2 years ago and to this day I still think that it sounds like crap in comparison to my heroes. However, compared to the stuff I was making 2 years ago I'm LIGHTYEARS better than I was then. The only way I'm able to get better is by trusting my intuition when things sound like crap and not trying to lie to myself by saying that things actually sound good. Then I mess around with things until I can get things to sound good and my mixes improve.