Amalek came and fought Israel at Rephidim.
Moses ordered Joshua: "Select some men for us and go out and fight Amalek. Tomorrow I will take my stand on top of the hill holding God's staff."
Joshua did what Moses ordered in order to fight Amalek. And Moses, Aaron, and Hur went to the top of the hill.
It turned out that whenever Moses raised his hands, Israel was winning, but whenever he lowered his hands, Amalek was winning.
But Moses' hands got tired. So they got a stone and set it under him. He sat on it and Aaron and Hur held up his hands, one on each side. So his hands remained steady until the sun went down.
Joshua defeated Amalek and its army in battle.