Use a straight pin to gently pull out all of the knots. If that doesn't work, place the necklace on a hard, nonporous surface such as glass. Apply several drops of baby oil or mineral oil to the chain, then use the pin to untangle the links. Proper storage should help prevent tangling.
Depending on the size of the necklace, you can drop it through a straw, wrap it around an empty spool of thread, or hang it on a nail attached to a bulletin board or other surface.