Don’t throw the baby out with the bathwater is a popular phrase which means discarding something valuable and good when trying to get rid of something bad, or in other words rejecting something that is valuable to get rid of something that is worthless.
The phrase is used in the negative to warn against thoughtless and irresponsible behavior.
For example-
Amanda leaving her old friends because of a silly argument is like throwing out the baby with the bathwater.
The origin came from this phrase in the mid-1500s when, due to the scarcity of water, families were only allowed to use one tub of water to take a bath. First the father, then the wife, the children and finally the baby. Finally, when the baby is being bathed, the water will be so dirty that the baby might be thrown out with the bathwater.