Child custody battle?

my ex has put me through absolute hell the 3 years we were together and it’s been 6 months since we have broken up and we currently have a daughter who’s almost 2 and it’s been absolute hell with him which has caused so much built up anger towards him. I thought everything was going well but we got into a huge text argument a week ago and because of that he’s keeping my daughter from me. He has a lot of text messages of me cussing him out because of this whole situation I’m just curious could that make me lose custody of my child? He’s even worse than me but he doesn’t want to act like it over text because he knows I’ll use it against him. He has a way of convincing people he’s a good guy but honestly it’s the other way around. I feel like giving up so bad I feel like I’ll never win against him and it’s hurting me so much that idk when I’ll ever see my child again.. 😢😖 I’m trying to get custody but courts were closed today for some reason.. he knows he can get away with this because there’s no court order.. this guy called me a bitch while I was pregnant with his child and threatened to kidnap my daughter and take her off to Mexico because he doesn’t have papers :((