Condom came off and he came inside me

Miranda

So my boyfriend and I were having sex and it felt like the condom was still on. But when we finished he pulled out and it was completely off. Like TMI but I ran to the bathroom and basically gave birth to a condom and sperm. We literally ran to target and bought this

Plan B was waaaay expensive and basically I’m asking if this works the same way and if anyone has taken it?

EDIT- thank you all for the advice! I woke up this morning with my period! It came WAY earlier than expected but I’ll take it! Thank you all so much!!