If I remember correctly there was a study done back in 1985 that showed that drinking coca cola killed off the sperm in a mans body which prevented the man from getting the woman pregnant.
However I wouldn't think that would be 100 percent true because my dad drank coca cola often and he still got my mom pregnant and I drank coca cola myself and I got my wife pregnant with 4 kids all during the time I drank coca cola.
So while coca cola may kill off some sperm and prevent some pregnancy it's not 100 percent that it will do so.
The men who killed off their sperm after drinking coke likely were not that fertile with their sperm to begin with and the coke just killed off the sperm more.
Or the woman was not fertile enough herself because the woman and the man need to be fertile as in the man needs fertile sperm and the woman needs fertile eggs.
If you want to prevent pregnancy then either don't have sex at all or use a condom or other birth control pills etc.