Start by dampening the detergent stains. Remember that you are just required to dampen the fabric, not soak it in water. For this reason, you should spray water from a bottle onto the fabric instead of holding the fabric under water from a tap. Moreover, the spray bottle you use should be completely clean from the inside.
Vigorously rub a bar of soap into the laundry stain areas. Allow at least a couple of minutes for the soap to set in and then wash the piece of fabric you are treating. Check and see if the detergent stains have been removed or not. Move on to the next step if detergent stains are still present on laundry.
Add undiluted white vinegar to a bucket and soak the fabric you are cleaning in it. Allow 15 to 30 minutes for the vinegar to set in properly. Check if the detergent stains disappear. To get rid of the vinegar smell, be sure to add a few drops of fabric softener.
If the detergent stains you are cleaning still do not go away, do not try anything else at home. Instead, take the fabric to a professional cleaner in order to get the stains removed.