But the Sahara is a really dry desert, and for the most part people do not live in the desert (though actually the Sahara was not as dry in antiquity as it is now). But even in antiquity it hardly ever rained in Egypt.
The reason people did live in Egypt, though, was that the Nile River runs through the middle of Egypt. The Nile is a big river. It starts in the rain forest south of Ethiopia, south of Egypt, near the A at the end of the word Africa on this map, and it flows north into the Mediterranean Sea. (If it seems funny to you that a river flows north, so that it looks like the water is going up on the map, you’re not alone. Lots of people find this hard to remember).
The way this worked in antiquity was that every year it would rain so much in the silt), carried down the river from irrigation ditches that they dug with wooden or bronze picks and shovels. As soon as you are too far from the Nile to get the water to the fields, it turns back into desert again (as you can see in the picture).
Learn by doing: find out which rivers near you flow north, and which flow south
More about ancient Egyptian plants and animals
Farming & Food (The Ancient Egyptians), by Jane Shuter (1998). Easy reading.
Everyday Life in Ancient Egypt, by Lionel Casson (revised edition 2001). Not as easy reading, but pretty entertaining, and Casson knows what he’s talking about.