The Shulhan Aruch (Orah Haim 442) rules that if a product contains Hametz, but is inedible such that even a dog would not eat it, one may have such a product in his home on Pesah. This Halacha is relevant to many products which we have that often contain Hametz, such as shoe polish, ink and makeup. Such products occasionally contain Hametz, but since there are wholly inedible, even for animals, one may have them in his possession and use them during Pesah. As long as a product was inedible for dogs before Pesah, it may be used on Pesah.
This ruling applies to medicines, as well. If a medication contains Hametz but in its present form has no flavor, is meant to be swallowed and not chewed, and a dog would not want to eat it, then it is technically permissible to ingest the pill on Pesah, according to Sephardic custom. Nevertheless, one should only take such medication if he is sick. One who has a mild headache and the like should use only medications that do not contain Hametz.
Another example of this Halacha is tobacco and snuff, which occasionally contain Hametz but may nevertheless be used on Pesah since they are unsuitable for consumption even for dogs.
Likewise, one may, strictly speaking, use detergents and soaps that contain Hametz, since they are not fit for consumption for dogs. Nevertheless, since there are kosher for Pesah soaps available, it is preferable to use such soaps on Pesah. Certainly, however, if one is unable to obtain soap that is certified kosher for Pesah, he may use ordinary soap, since, as mentioned, it cannot be eaten even by dogs.
Summary: Products that contain Hametz but are unfit for consumption even for dogs may be used on Pesah. These include cosmetics, shoe polish, medicinal tablets, soap and snuff. Nevertheless, one should not take a pill containing Hametz unless he is sick. Moreover, when it is possible to obtain a product made without Hametz, it is preferable to do so.