Yes. By taking the contraceptive pill as instructed, you will be protected from getting pregnant. Please note that if you miss taking the pill, you may not be protected. Also when starting the contraceptive course, note the time that it takes to become effective, which is on the product information leaflet.
The contraceptive pill does not protect you from STIs.