Don't know what to do ??!

My boyfriend has days where he will be very mean and anything I say or do is not good enough for him so he gets ignorant and I'm already insecure about everything about myself , some of the things are very hurtful I am 3 months pregnant as well so I've been more sensitive than usual about it ! When we are good we are great and I cherish those days bc I hate the days like this where he has nothing to do with me and seems he could care less if I fell off the face of the earth right now :/ it's so hard to try and try to get along with someone and only get effort 20% of the time so I gave up when he acts this way I stay to myself which with the depression and other problems I have make it worse for me , I don't know what else to do .. It's just hard to leave knowing we can be great together and that I am pregnant with his child