Birth control

I started taking my birth control the same day I became fertile and had unprotected sex on the 6th day of ovulation. I was wondering if birth control works if I was already fertile?