Birth Control Pill

How does it work ? Is is effective directly after you take it or not ?