Avoiding pregnancy

What is the most effective way to avoid pregnancy? I’m getting on birth control because I’m scared of an iud, and I know that I will take the pill everyday like your supposed to, but I’m afraid that I will still get pregnant