How did the egyptians control the Nile River?

Egyptians managed to control the flooding of the Nile River for their own benefit. They would dig irrigation systems from the Nile to their farmland. When the Nile overflowed, the water would fill the irrigation ditches and water the crops. Thus, the Egyptians managed to tame the Nile.