If they won’t accept your offer of peace but declare war on you, set up a blockade around the city.
If they accept it and open ⌞their gates⌟ to you, then all the people there will be made to do forced labor and serve you.
When the Lord your God hands the city over to you, kill every man in that city with your swords.