There are a variety of fabrics that leotards are sewn from--some a little more fickle than others. It is generally recommended to hand-wash in cold water with mild detergent, squeeze water out but do not wring. Hang to dry immediately. Do not let a leotard sit bunched up while wet (either sweat or water). This care will allow your leotard to last. This is especially important if your fabric has a shiny look to it.
Another good option is to turn the leotard inside out and wash on cold water, inside a mesh bag. Remove from washer immediately and hang to dry. This method works fine for nylon spandex and polyester spandex without bling, vinyl transfers or metallic/shiny overlays. This method is not recommended for metallic, foggy foil, vinyl transfers or blinged items.
Do NOT use hot water, dryer or iron. The spandex fibers that create that wonderful stretch and give to your leotards does not like heat and is damaged by it. Overtime, exposure will cause the spandex to lose it's ability to "snap back" and hold firmly against your body. You don't want your leotard to look like one of those swim shirts after a long summer of swimming--saggy and thinned out!
Do NOT use bleach. Cover your leotard with a towel or shirt, before using aerosol sprays. The mesh is a fun, surprisingly sturdy fabric, but it is NOT friends with velcro!