There are several causes of abortion in goats. It could be diseases (and there are several that cause abortion), nutritional causes or due to deficiencies.
Once this happens, please seek the services of your local veterinarians who would, among others, collect samples from the aborted foetus for laboratory analysis and later advice on the best treatment based on lab results.
Identify animals that have aborted and isolate them from the rest of the herd.
Bury or burn aborted materials to avoid spread of infections to other goats.
Remove all beddings from the abortion area, disinfect and leave vacant for as long as possible.
Keep personal safety in mind, always wearing protective clothing and washing your hands thoroughly after handling animals or equipment as some of the diseases are transmitted to humans.
Other prevention measures include not allowing the animals to drink stagnant water; preventing feed contamination; employing strict sanitation measures; keeping a closed herd/flock or only purchasing from known clean sources.
Keep new animals separately until after giving birth and secure any stored forage and grain, if any, from contamination by cats faeces (to prevent diseases like toxoplasma which also cause abortion).
Further, minimise stress to the animals by providing adequate nutrition, feeder space and room.
Keep bred does and ewe lambs separately from mature does and sheep and do not mix bedding between kidding pens and other animal holding pens.