For example, to subtract out the component of a vector a along unit vector b, you just take the dot product of a and b and multiply by the vector b. Then you just subtract a•b*b from a to take out the component of the vector along b.
How do you do this for a rotation? Rotations can be represented by euler angles, rotation matrices, or quaternions. The quaternion is a certain rotation about an euler axis, but how do you subtract out the component of the rotation about a given axis?