They act as a high impedance, to high frequency EMI/RFI electronic noise.
Ferrite cores are one of the simplest types of interference filters to install on electronic cabling.
They work best located nearest the equipment end of the wire. Not at the wall receptacle.
If you have a ferrite ring, the wire is simply wrapped around the core through the center a few times. I've used clamp-on also.
I've seen them at Radio Shack.