It works by breaking down the coating that helps the adult or young insect retain moisture in its body. Once this coating is disrupted, the insect dehydrates and dies. Many commercial mixtures are readily available - a common brand name is "Safer"
A homemade insecticidal soap can be made from adding a tablespoon or two of dishwashing detergent to a gallon of water. A few drops of cooking oil can be added as well, which will help the mixture cling better.