I had the pill just in case is that really bad ?

So I had sex with this guy last night and he wanted me to take the pill just in case so I did , I'm not sure if I did the right thing tho .....