You can prepare for court by gathering evidence that helps explain why you should have custody. Your evidence should relate to the “best interest factors” that a judge looks at to determine what’s best for your child. You can see How will a judge make a decision about custody? for more information.
Custody cases are complicated, so you may want to get a lawyer. If you can hire someone, you can use this list of questions as your guide when deciding which lawyer to choose. If you can’t hire a lawyer, you may at least want to try getting a free or low-cost consultation to help you make a legal strategy for your case.