Deuteronomy_Chapter 20
When you go out to fight against your enemies and see horses, chariots, and a people greater than you, do not be afraid of them, for the Lord your God, who brought you out of the land of Egypt, is with you.
When you are about to go to battle, the priests shall come to the people and proclaim,
“Listen, O Israelites, that you will be at war with your enemies today. Do not be afraid, do not be afraid, do not tremble, and do not be afraid of them.”.
For the Lord your God is with you to fight against your enemies and save you.
The officials shall also declare to the people, saying, Whoever builds a house and has not yet offered it, he may go home, or else he may die in battle and others may offer it.
Whoever grows a vineyard and has not yet used the fruit they produce, he can go home, or else he may die in battle and others will use it.
Whoever has betrothed a wife but has not yet married, he can go home, or else he may die in battle and someone else will marry him.
And the officials shall declare to the people, saying, Whoever is afraid or cowardly, let him go home, lest his brother’s heart be consumed like him.
When the officials have announced to the people that it is over, they should send a military commander to lead them.
When you approach a city and are about to attack, first declare peace to the people of the city.
If they answer you in peace and open a city for you, all the people in the city will serve you and serve you.
If you refuse to reconcile with you and instead want to go to war with you, then besiege that city.
The Lord your God has delivered the city into your hands, and you shall slay all the males of this city with the sword.
Only women, children, livestock, and all the goods in the city can you take as your own plunder. The Lord your God has given you the wealth of your enemies, and you may eat it.
All the cities far away from you, not the cities of these nations, you must treat them like this.
But for the cities of these nations, which the Lord your God has given you as an inheritance, no breath shall be left among them.
Just as the Lord your God has commanded, completely destroy these Hittites, Amorites, Canaanites, Perizzites, Hivites, and Jebusites,
So that they may not teach you all the detestable things that they have done to their own gods, so that you may sin against the Lord your God.
If you are besieged for a long time and attack the city you want to take, do not use an axe to cut down the trees. Because you can eat the fruit on that tree and not cut it down. Are the trees in the field human, to be wasted by you?
Only the trees that you know are not fruit trees can be destroyed, cut down, and used to build fortifications, attacking the city that is at war with you until it collapses.