If you've run this hydraulic system too long, see above blog message from big ben, but if you catch it in time there may be a quicker way.
Once you have a catastrophic failure and metal is detected in your oil analysis, (please tell me you're doing oil analysis) you must take immediate action. Get a projectile unit such as Ultra Clean Technologies and "pig" all the lines downstream of the pump. Depending on how long and how bad it is , you may have to pig all the lines. This can be an involved project.
Then set-up a kidney-loop using the best filtration possible at the reservoir. Use the filtercart to pump in new oil (or the existing oil as is may be good oil, just full of debris that a good filtercart will stop), let it kidney-loop for an hour or so then slowly begin the process of moving motors and activating the hydraulics (short strokes, small movements) STOP, let the kidney-loop clean what it can for another half-hour or more, repeat. Repeat for about 12 to 36 hours depending on the volume of oil in the system.
We've had great success with a large excavator by removing water-from-oil after the system got contaminated by an attached tool.
Good Luck
Doogie B - Filtramax