Before cleaning the filter, make sure to unplug the washing machine from the power source and turn off the water supply. This will prevent any accidents or water leakages during the process.