Can we avoid mental retarded state of child born with cousin marriage?

Hard to say. Geneticists estimate that each of us carry a few recessive genes that will not harm us, but when paired with another can produce a baby with things like CF, sickle cell, and any of thousands of metabolic disorders like PKU.Marriage between close relatives increases this risk.You can get tested for the recessive gene in some cases, so having a consultation with a geneticist may help you.
Consanguinity . When parents share genes, such as what occurs with close relatives, there is a higher risk for birth defects, including risk for mental retardation, because there is less admixture. Small defects that may be present on one of the parents' genes have less chance of getting diluted or corrected with another, unrelated partner's normal genes. Overall risk is increased to 6% in one study.
Don't know. There are many causes of mental retardation, now called intellectual disability. Genetics is one of these, but not the only one. Genetic testing of the parents may be helpful, but we are not sure of all of the genes that contribute to this disorder. Get a referral to a geneticist and go from there. You may also want to contact AAIDD.