Adding fabric softener to reduce foam.
It's good to use to knock down suds but less detergents should be used to combat this minor problem.
With a front loader, the second rinse should be suds free but with a hint of a white ash look in the water or none at all.
Sometimes it's the machine leaving suds in the sump area causing redeposits.
If suds are seen during the third rinse, it's time for a change in detergents!