How do I get a custody order?

A court has to grant a custody order. A custody or conservatorship can be ordered by a judge as part of a:

divorce, 

suit affecting the parent-child relationship (SAPCR), 

paternity suit, or

family violence protective order case.