In case a barrier method fails, such as a condom breaking, emergency contraception (EC) can be used to prevent pregnancy. EC is most effective when taken as soon as possible after unprotected intercourse. It is also important to get tested for STIs if there is a risk of exposure.