Match the filter to the model
Each filter is made for a particular machine or family of machines, so match the model name on the unit rather than measuring the old filter. Most units filter in stages: a coarse pre-filter catches hair and larger dust, a HEPA (high efficiency particulate air) filter traps fine dust and mould spores, and a carbon filter takes out smells. On a commercial dehumidifier, the intake filter keeps dust off the cold coil inside.
Which filter is due for a change
The pre-filter needs cleaning or changing most often, because it stops coarse dust reaching the finer filter behind it and makes that filter last longer. A HEPA filter is due when airflow stays low even with a fresh pre-filter, or when a filter gauge or warning light, where fitted, says so, and a carbon filter is due when smells start coming back. Running on a clogged filter makes the machine work harder for less clean air.
Fitting and disposing of used filters
Switch off and unplug the machine before opening it, fit each filter the right way round, following any airflow arrow, and check the seals sit flat so no air slips around the edges. Used filters hold everything the machine has caught, so handle them with a mask and gloves and seal them in a bag straight away, especially after mould or fire damage work. Keeping a spare set means a clogged filter does not hold up a job.