help!!

my boyfriend and I were having sex last night. everything was great until I started to have some pain. I felt like the condom broke so he pulled out. he did not cum in me but there was probably some precum in the condom. he started to freak out because we are kinda young. I do not want to be pregnant. what should I do? I was going to get a plan b pill but I'm not able to go to store until Saturday, which is like 48 hours after the fact. will it still work? my period is also supposed to start next week. thank you!