The contraceptive pill containing estrogen and progesterone works by preventing ovulation, thickening the cervical mucus to make it difficult for sperm to reach the egg, and thinning the lining of the uterus to prevent implantation of a fertilized egg. These actions combined help to prevent pregnancy by making it less likely for an egg to be fertilized and implanted in the uterus.