The Hebrews dwelt in Goshen and probably drank from a different river, either a tributary or a distributary of the Nile, rather than from the Nile itself.
If from a tributary, then that water would have not been affected by the state of the main river into which the tributary flowed.
If from a distributary then divine providence may have caused the water to be clean downstream from the contamination.
In 1885 Édouard Naville identified Goshen as the 20th nome of Egypt, located in the eastern Delta, and known as "Gesem" or "Kesem" during the Twenty-sixth dynasty of Egypt (672–525 BC). It covered the western end of the Wadi Tumilat.
Wikipedia - Land of Goshen
Wadi Tumilat (Old Egyptian Tjeku/Tscheku/Tju/Tschu) is the 50-kilometre-long (31 mi) dry river valley (wadi) to the east of the Nile Delta. In prehistory, it was a distributary of the Nile. It starts from the area of modern Ismaïlia and continues from there to the west.
Wikipedia - Wadi Tumilat