There are many options to choose from depending on the severity of the ambiguous genitalia. If the child is born with female organs internally, usually the doctor will recommend the removal of any external male parts, such as a scrotum (generally without testes, but sometimes testes can be inside the scrotum) or rudimentary penis. Generally if the child is born with no internal female organs but has testes and a penis, no matter how small or underdeveloped, the doctor will recommend keeping the child a boy, and may suggest corrective surgery to either repair, enhance, or "normalize" things down there.
If the child is born with BOTH male AND female organs (i.e., ovaries, testes, a uterus, a vaginal opening, prostate, penis, or a combination of a few of each male and female organs), I think the doctor will give you a few other options to choose from, such as choosing the sex of the child and then gender reassigning, keeping the child the way he/she is (no pun intended there), provided that there are no conditions that will inhibit puberty or urination (such as hypospadias, where the urinary tract forms in an abnormal area, such as on the underside of the penis; or in the case of inhibited puberty, there may be no vaginal opening for menstrual flow). If there are issues with urination, usually your doctor will recommend corrective surgery as soon as possible. If issues may arise with puberty, usually your doctor will recommend waiting for puberty to come in order to determine if a menstrual cycle comes or not. If a menstrual cycle occurs, the doctor may perform a surgery to allow the flow of the menses. Ultimately, it will be up to you to decide what to do regarding your child. With information that your child's doctor can provide, you may be able to make a better informed choice. It honestly all depends on the severity of the ambiguous genitals. If the condition is minor, you may even choose to not have anything done.