The most common reasons for a washing machine over foaming are using too much detergent and not using a quality detergent. We would therefore recommend for you to use the correct amount of detergent for your washing load as per the recommended guidelines found in your instruction manual, and also use a good quality detergent.
For more information about how much detergent and which detergent you should use, click the link below.