We’ve shared countless methods for managing your cables, but if you have one that you need to unplug or move around frequently, your best bet might be a magnet and a small spring.
All you need to do is take a metal spring from a ballpoint pen, and coil it around your cord. If it slides around a little too loosely, a piece or tape or Sugru should hold it in place. Then just attach a small, strong magnet to the back of your desk. As long as it’s strong enough, it should hold the spring and wire in place until you need to move it, and make it really easy to put the cord back in position when you’re done. This is especially great if you want to store the cord behind your desk, because you can mount it in place without having to look for a hook or manipulate any clips.
This will really only work well with thin cords, and you’d be better off using a rain gutter for a comprehensive cord management plan, but this is great for headphone wires or USB charging cables that you need to move around frequently.