Deuteronomy 2:4

And command thou the people, saying, Ye are to pass through the coast of your brethren the children of Esau, which dwell in Seir; and they shall be afraid of you: take ye good heed unto yourselves therefore:

The brethren to be passed through were Israel's own relatives, the descendants of Esau dwelling in Seir. The direction was to travel through their coast or territory of Edom on the route toward Canaan. The Edomites would be afraid of Israel, yet safe passage through their land was promised. The command to take good heed to themselves meant to be careful in dealings with Edom and to respect the set limits by not exploiting that fear, not preying upon them, and not provoking or harming them.

The connected instructions also required buying food and water from the Edomites rather than taking them. In the same context Israel was likewise forbidden to contend with the Moabites or Ammonites in battle or to take their land, because those territories had been given to the descendants of Lot. This belonged to the time when Israel was about to enter a fertile, well-watered country lying on the direct route to Canaan, so that the cessation of the miraculous water supply signaled that the wilderness wandering was ending and the promise was being fulfilled, and failure to discern this revealed unbelief.