Colour filters work by filtering out particular wavelengths so that only certain colours can pass through the filter. So, colour filters absorb all of the colours except the colour of the filter, which is transmitted.
For example, if we pass white light through a blue filter:
White light contains all of the different wavelengths of light. So when passing white light through a blue filter, only the blue light will be transmitted and the other colours will be absorbed. This means that the blue light will come out the other side, reflecting into our eyes.
An object will appear black if the filter absorbs all the wavelengths of visible light. For example, when a green light passes through a blue filter:
If a green light is passed into a blue filter, no colour will be transmitted, so it will appear black.