When you are encamped against your enemies, keep away from everything impure.
References for Deuteronomy 23:9
If one of your men is unclean because of a nocturnal emission, he is to go outside the camp and stay there.
References for Deuteronomy 23:10
But as evening approaches he is to wash himself, and at sunset he may return to the camp.
References for Deuteronomy 23:11
Designate a place outside the camp where you can go to relieve yourself.
As part of your equipment have something to dig with, and when you relieve yourself, dig a hole and cover up your excrement.
For the LORD your God moves about in your camp to protect you and to deliver your enemies to you. Your camp must be holy, so that he will not see among you anything indecent and turn away from you.
References for Deuteronomy 23:14