"We don't want to throw the baby out with the bathwater" is an idiom. It means that you don't want to get rid of something that is necessary (foundational), good, or beneficial (helpful) when trying to get rid of something that is bad.
For example, if you had an idea for a computer app but found that there was an issue with your coding, you wouldn't want to throw out the whole idea for the app. You would want to keep the idea but rework/redo the coding. The "baby" in this case is the great idea for the app -- the bathwater would be the coding problem. Hence, you wouldn't want to throw the baby out with the bathwater.