Answer:
Through Irrigation, Herding, and Agriculture
Step-by-step explanation:
The harsh climate in Egypt and Mesopotamia provided them with very little rainfall. So, they created an advanced irrigation technology that allow them to distribute waters from major rivers the neighborhood where citizens lived.
As for food, ancient Egypt's and Mesopotamia use similar method as European countries. Through animal farming and Agriculture. Their climate still enabled several types of grain, fruits and animals to survive. (such as Flax, Goats, pomegranates, etc)