Some miscarriages can't be prevented. The best anyone can do is take care of themselves. Stay away from alcohol, drugs, and high impact activities. If you are ordered to be on a more restrictive set of activity, then follow it. Other than that, relax and enjoy.