Turn off and unplug your vacuum. Move the vacuum near a trash can or outside to cut down on dust particles re-entering the air in your home, or near a sink for washable models. Remove the filter according to the manufacturer's instructions.
Tap the filter against the inside wall of the trash can to loosen all dirt and debris. Continue tapping gently until the filter does not release any more dirt or dust. This is the best approach for filters that should not be washed or brushed.
Hold the filter over the trashcan. Use a soft-bristled toothbrush to gently brush off dirt from the filter. Employ downward, even strokes to ensure that you are not just moving dirt around the filter instead of cleaning it off. This is the best approach for filters that cannot be washed, but can handle a gentle brushing.
Put washable filters only under gently running water. Slowly rotate the filter under the water flow to rinse off dirt. Refrain from brushing or using any cleaning agent, which can both damage filters. Use this approach only if your vacuum specifically states that washing the filter with water is OK; water can damage filters not meant to get wet. Leave the filter out of the vacuum until it is fully dry.