Now Amalek came and fought with Israel in Rephidim. And Moses said to Joshua, “Choose us some men and go out, fight with Amalek. Tomorrow I will stand on the top of the hill with the rod of God in my hand.”
Exodus 17:8-9 NKJV
God had been with Moses time and time again when the Israelites were in trouble. When the Amalekites came to fight Israel, Moses took his staff and held it high above his head. God provided for the Israelites once again.
And so it was, when Moses held up his hand, that Israel prevailed; and when he let down his hand, Amalek prevailed. But Moses’ hands became heavy; so they took a stone and put it under him, and he sat on it. And Aaron and Hur supported his hands, one on one side, and the other on the other side; and his hands were steady until the going down of the sun. So Joshua defeated Amalek and his people with the edge of the sword.
Exodus 17:11-13 NKJV