Amniocentesis (also referred to as amnio, amniotic fluid test or AFT) is a prenatal testing procedure with significant accuracy. It involves collecting an amniotic fluid sample from the uterus and testing it in the laboratory for certain fetal abnormalities and genetic conditions. 
AFT is usually performed during the second trimester, particularly between the 15th and 20th weeks of pregnancy . It may also be performed during the later stages of pregnancy (third trimester), especially before a pre-term delivery or a c-section birth.
The step by step procedure includes performing an ultrasound to ascertain the positions of the baby, the placenta and the amniotic fluid pockets, then disinfecting the mother’s belly area with an antibacterial solution to prevent infecting the fluid while collecting the sample . Next, the diagnostician collects around one ounce of amniotic fluid using a thin needle while monitoring the path of the needle on ultrasound. The ultrasound also helps to make sure that the baby’s heartbeat is normal after collecting the fluid sample. It is then sent to a clinical laboratory for karyotyping  – a process used for examining the chromosomes in the cells within the sample.
It is not a painful process as most women feel only a sharp pinch, along with a lot pressure, when the needle goes through the uterus. Some women can barely feel it when the needle is run through the abdominal skin, but may feel a sharp pain when the needle goes through the uterus (it does not last for more than a few seconds).
Depending on the purpose of the test, the results are available:
Having a FISH (fluorescent in situ hybridization) test along with an amnio helps to get the results within a couple of days instead of weeks. It has a significant accuracy rate in predicting chromosomal abnormalities in the baby. 
It is a fairly safe screening procedure that often does not cause any side effects; however, some women may experience:
The risk of miscarriage associated with the test ranges from 1 in 300 to 1 in 500 . According to researchers, having amniocentesis before the 15th week of pregnancy increases the danger of a miscarriage. The chances of miscarriage are somewhat higher in women carrying twins or triplets.
Chorionic villus sampling (CVS) is another prenatal screening test that helps with the diagnosis of chromosomal abnormalities in the fetus. Although, the basic purpose of both amnio and chronic villus sampling is to detect chromosomal or genetic abnormalities in the baby, their procedures are completely different. CVS involves collecting cell sample from the tiny finger-like projections called chorionic villi, located on the placenta . The sample is then sent to a lab for genetic analysis.
One of the main advantages of amnio over CVS is that the former can detect neural tube defects (spina bifida) as well as chromosomal defects in the baby  while the latter cannot. On the other hand, CVS has the advantage over amnio as it can be performed during the first trimester (typically between the 11th and 12th week), which enables parents to know whether their baby has any serious birth defects at an earlier stage.
There is a new non-invasive fetal DNA test that can be used instead of amnio . This cell-free blood test produces accurate results while there is no risk of miscarriage. In this test, a blood sample is collected from the mother to examine the DNA of the baby for any abnormalities.
Its cost may vary from one country to another, ranging from $1,000 to $1,500.