Metal files are composed of small metal teeth, or ribs, with shallow "valleys" between them. The ribs are sharp enough to rub off metal or wood from an object being sharpened or smoothed, and the job of the valleys is to provide particles a place to safely fall off the file during use. Some specific metal and wood particles won't fall out of the valleys and will become compacted, preventing the file from performing correctly. The shavings or wood fibres must be cleaned out of the valleys occasionally.
Lay your file on a flat surface so that one of the flat sides is facing upward, near the edge of your workbench.
Place two C-clamps, one on each end of the file, with the bottom surface resting against the underside of your workbench. Tighten the clamps just tightly to hold your file solidly in place so that it won't move.
Place the end of a piece of scrap wood on the flat surface of the file, along the edge, and press the wood in a diagonal direction so that it follows the grooves of the file, rather than crossing them. Press down as hard as you possibly can while moving the wood along the grooves and repeat in the same grooves two or three times until the caked debris are removed. Move along the entire length of the file, removing all of the debris from all grooves, and then do the same for the other side of the file. You will notice that any rust on your file will also be removed during the rubbing process.
Don't use solvents or oils on a quality metal file. The solvents and oils will leave a film in the grooves of the file, causing particles to accumulate in them even faster during subsequent uses.