Plans B, I don’t know which group to put this under

Ki ki • Angel mommy 04/7/2019 👼🏾💛

How does plan b actually work? Does it fail when you have sex during ovulation and take it the next day? Or are you suppose to take it before you have sex ?