Medieval folk didn't drink alcohol to avoid dirty water

I didn’t know that. It makes sense. Any good reading on that?