I had a misscarriage

Why? Was doing everything right, i mean vitamins, evrrything and i have a misscarriage