PLEASE HELP!!!

My partner and I are trying to prevent pregnancy, as We are both students and I have health issues that would put me at risk if I were to become pregnant. 
We were having sex today and before he came, he pulled out. As he was pulling out, the condom slipped and became stuck inside me. I didn't notice until we had both finished and he was frantically looking for the condom (which was still inside of me by the way).😁😁😁😁😁 
Should I take an emergency contraceptive? I'm on day 3 of period and cycle. Also, what can I do in the future to avoid this? Your help is greatly appreciated. Thank you 😊😊😊😊