Spermicides function by disrupting the cell membrane of sperm, thereby immobilizing and killing them. This prevents sperm from fertilizing an egg. They are usually inserted deep into the vagina before intercourse, ensuring that they come into contact with sperm as soon as possible.