Spacecraft on longer-duration missions, in order to conserve fuel, are designed to use reaction control systems to control their attitude as little as possible, in order to avoid burning irreplaceable (or difficult to replace) fuel. Control moment gyroscopes and reaction control wheels are the most common systems in use for spacecraft that have arbitrary pointing requirements. Satellites in orbit, designed to maintain a constant attitude with respect to the body they are orbiting, will often use passive systems such as a gravity gradient tether. In any case, however, systems that use momentum transfer for attitude control (such as control wheels and gyros) can reach a state of saturation, where they are unable to provide torque in the desired direction. In the case of wheels, it is generally because one or more wheels has reached its maximum RPMs and cannot be further accelerated in the direction necessary for further maneuver. For gyros, if enough of the gyro rotors are aligned in the same direction, they will be unable to provide torque around the related axis.
When this occurs, the solution is to transfer - 'dump' - momentum from the control systems. Since momentum is conserved, this generally means applying a torque to the spacecraft using a means other that those control systems, so that they can be set to generate an opposite torque in a direction that desaturates them. There are several ways that this can be done, depending on the systems available and the spacecraft mission.
The most common is to use a reaction control system to provide an impulse for the saturated system to counter. In effect, transitively, this involves trading the momentum of the RCS exhaust for the momentum in the system - dumping it outside the spacecraft into the exhaust vector. This is still a desirable way to handle attitude control, because generally, if the spacecraft's required realignments mostly cancel each other out over time, no propellant will be required until saturation in one particular direction is reached. Another possibility for larger spacecraft with power budgets as appropriate is to use magnetorquers - electromagnets which when activated create a magnetic field around the spacecraft which interacts with an ambient (Earth's, solar, etc.) magnetic field. This will induce a torque on the spacecraft, which can be used to 'dump' momentum into the surrounding magnetic field. This is much more efficient if your craft uses renewable electric power; however, it is generally a much weaker impulse, meaning momentum dump maneuvers will take longer, and the direction in which it can be applied is dictated by the local magnetic environment. The Hubble Space Telescope uses magnetorquers in conjunction with reaction control wheels as part of its 'Pointing Control System.' The HST must make frequent smaller changes to its orientation in order to aim its sensors, so having the ability to perform momentum dumps without using RCS significantly extends its lifespan.