There is no universal solution with this problem but there are some tips on how you can troubleshoot this.
1. If you are using laptops or netbook, the AC Adapter may be grounded, unplug it while recording.
2. You can use Audacity Noise remover http://audacity.sourceforge.net/ its free.
3. You did not push the jack far enough into the plug hole. Do not force but gently push it further in..
4. Use headsets with USB, it does not deteriorate as easily as mini jack connections, thus reducing static considerably.
5. Google is your best friend 🙂