Imiquimod 5% cream is primarily used to treat genital warts, actinic keratosis, and basal cell carcinoma. It works by stimulating the body's immune system to produce substances that help fight the virus causing genital warts. For actinic keratosis and basal cell carcinoma, the exact mechanism is not fully understood.