Color filters help you to alter the way the various colors in a scene are translated to shades of gray.
For example:
- a red filter means that the black and white image will be derived more from red light, which tends to make skin look softer and lighter. It also makes a daytime blue sky darker, which can lead to a more balanced looking contrast.
- other colors and shades create other effects
In digital photography, don't put a color filter over your lens. You just decrease the light getting to the sensor, increasing noise for no good reason and decreasing the ability for the bayer interpolation to give you decent resolution. What's more, if you leave your camera on auto WB, your camera's white balance is likely to try and boost whatever colors you try and cut too reducing the effectiveness of what you were trying to achieve.
Instead, with digital you do this color filtering in post-processing. It has the same effect, but it's more flexible and cheap. For this you can use "channel mixer", or you can use "color balance" or "curves" or other tools on individual color channels to alter the relative color makeup before converting to black and white.
As others have said, there are certain limited situations where it may be desirable to use lens filters in digital photography, but it is usually for unrelated reasons than to affect the bias of colors for making a black and white image, which is what this topic is about.