I don’t know your situation in detail, and also don’t know the other side of the story, but are you also providing your part of duties in a relationship?
Does he receive enough love, appreciation, sex and intimicy from your side?
Or does the child receive all of your affection?
Does he provide all the time but does not receive the things back from you that he expects to receive back from you?
I am mentioning this, because in many relationships men have this unhealthy subconsicous idea to treat the relationship as a transational exchange, i.e. sex in exchange for the provider role.
And then, if the transaction is not fulfilled (as promised to them by society and commercials because society has treated relationships as such transactions for Millenia), the man becomes angry. Angry at you and the child for not fulfilling your part of the transaction. And the child is only screamed at because it takes away your affection from the man.
This is one of the possibilities of what might be going on here and I am mentioning this because it is one of the most common cases.
It is statistical fact that with many couples the amount of sex and intimacy drops after several years of a relationship and even more so once a child is born.
If the relationship was built on a such a transactional assumption the whole time, and too many relationships are, then the man becomes resentful and angry, having the same feeling of being stuck and trapped in their provider role, without any longer getting the promised benefits of the relationship.
And then also, additionaly to what others mentioned:
If you do not love yourself and assume the victim role, you will be treated as such – whether this is justified (you really carry the victim role) or unjustified (you simply being the first subject to vent onto for a frustrated man).
If your carry the victim role and/or are not fulfilling your partner’s needs, then the only way forward (versus carrying on the problems into your next life phase) is solving these problems at the core, i.e. getting out of the victim role and becoming independent, or rekindling the fire in the relationship that you entered for reasons of stability and being provided for in the first place (if these were your reasons as you mentioned above and you entered the relationship also for the transactional reasons, then like your partner, you co-manifested the situation that you are both in).
PS:
That topic of people treating you bad seems to be really something that you manifest on a regular basis as you wrote here (which means you have to work on your self love and how you see yourself):