Basically, fill up a sink or a bucket with lukewarm water, add whatever shampoo you've got lying around (don't use too much) and work your fingers around the wig and through its fibers gently. You can add some conditioner if you like, in my experience it helps prevent tangles. Rinse it, and dry up the excess water with a towel. Let it dry out, maybe put it near a fan so it doesn't mildew. (This happened to me once, it was a pain!) Or, if the wig is heat resistant, you can use a blow dryer to dry it. Then you're done!
EDIT: Forgot to mention, if the wig is long, use the tub since it's got more room.
Fandom Fest 2014 cosplay: Kiki (Kiki's Delivery Service), Sai (Fragile Dreams), Sayaka Miki [mermaid] (Madoka Magica)
MCM London Comic Expo cosplay: Sayaka Miki [mermaid] (Madoka Magica), Kiki (Kiki's Delivery Service), Nagisa Momoe (Madoka Magica)
ALA cosplay: Emily (The Corpse Bride), Sayaka Miki [mermaid] (Madoka Magica), Kiki (Kiki's Delivery Service), Sai (Fragile Dreams)
2015 conventions: Anime Los Angeles, Anime Central, Japan Expo