Emergency contraception, or "the morning after pill" as it is sometimes called, works best if taken as soon as possible after any exposure to semen / sperm.
If the condom broke, or you had sex without protection, it is a great idea to prevent pregnancy before it starts, with Plan B, ella, or NextStep – the three brands of emergency contraception available today. They’ll work up to five days after unprotected sex, but are most effective the sooner they are taken. This is because they prevent the implantation of the fertilized egg into the lining of the uterus. Emergency contraception is totally safe to use, has minimal to zero side effects, and can be purchased over the counter or obtained from your local teen clinic.
For more information on emergency contraception, check out these sites.