Until there is a court order changing the default circumstances, both you and your spouse have equal rights when it comes to the care, custody, and control of the child or children. If your husband or wife withholds your child or children from you, then you will need to get a court order from a judge, determining temporary custody and parenting time while the divorce is pending. You should not delay in retaining a family law attorney when facing emergency custody issues such as this.
The temporary custody and parenting time order will outline a visitation schedule and outline decision-making authority for the time while you and your husband or wife are separated, but not yet divorced. The court will review the petition and enter the order. Each spouse has a right to have and maintain a relationship with his or her own child or children. A parent who continues to deny access to the child or children would then be in violation of the custody order and be at risk of being penalized by the court for contempt.
Although each parent of a child born within a marriage has equal rights toward that child, when one of those parents is not playing fair, it leaves the other parent with two options. They can steal the child or children back and keep them from their spouse. This is obviously not in the best interest of the child or children and may hurt your chances of ever gaining custody in the divorce. Instead, you should start the divorce process and take this issue up with the courts. This would always be the recommended solution, as would consulting a very experienced family law attorney to discuss your case in greater detail and learn all of your rights and options throughout your divorce.