New to the pill

Starting the pill for the first time. How long does it take to work and be protected? And is it best to wait an entire cycle to see if it has worked before engaging in any unprotected sex?