A diaphragm (like a cap) is a barrier method of contraception. It fits inside your vagina and prevents sperm from passing through the cervix. To be effective in preventing pregnancy, diaphragms need to be used in combination with spermicide, which is a chemical that kills sperm. You only have to use a diaphragm when you have sex, but you must leave it in for at least six hours after the last time you had sex. You can leave it in for longer than this, but do not take it out before.