Contraception injection
The contraception injection was a form of birth control used in the Federation. The medicine had to be administered regularly, otherwise  could lead to fertilization and pregnancy. 

During 2268 negotiations with the Gideons, Captain Kirk proposed that the Federation could provide any type of devices they needed to safely prevent conception. ()

In 2375, Benjamin Sisko, preoccupied by the latter stages of the Dominion War, forgot to renew his injection despite repeated reminders from his CMO Julian Bashir. As a result, his wife, Kasidy Yates, became pregnant with their child, the couple's first. ()

Appendices

Background information 
In The Making of Star Trek (pp.206-207), it is stated that the birth control practiced on board the  was never discussed in any episode of  because the censors would not have allowed it. But if it were to have been discussed, they would have explained contraception to be based on monthly injections mandatory for unmarried women and voluntary for married women. If a member of the crew became pregnant, she would have a choice between medical discharge or rotation to a shore base for the duration of the pregnancy.

External links 
 
 
Drugs
Sex and reproduction