Determine if you have a right to file a complaint for legal custody of the child in question. Legal custody cannot be obtained over the objections of parents who are deemed fit. If you feel the parents are not fit, you must prove this in a court of law before you can gain legal custody. If you are a parent who has not lost her parental rights, you only have to prove that your having legal custody is in the best interest of your child.
Go to the proper courthouse and file what is typically called a "Complaint for Custody." Be prepared to pay a filing fee. Fill out everything on the form to the best of your knowledge. This will prevent unnecessary lag time while the court looks for more information from you or the defendant.
Wait for a response from the court in the mail. It will inform you of a date for you to appear in court. Your first visit will be for mediation and/or pretrial. This will require you and the defendant to speak with a mediator in an attempt to come to an agreement. If you reach an agreement, it will go before a court official.
Bring the facts you have, witness lists and agreements with you to your pretrial hearing. This is so the judge can determine if you and the defendant have come to a logical agreement and to clarify the case for the judge. The judge will then determine if the case needs to go to trial.
Remember that as the plaintiff the burden of proof is on you. When you go to trial, you have to provide evidence to the effect that granting legal custody of the child to you is in the best interest of the child. Present all of your evidence at the trial and wait for the judge's decision.