Military training and the constant threat of death helped to maintain discipline in the trenches during World War I. The trenches held many different dangers for soldiers, and the best way to avoid harm was to follow orders and wait for nightfall or a change in duties.
FirstWorldWar reports that during trench combat, soldiers not only had to worry about sudden death by machine gun or sniper but also about rats as large as cats, lice, discomfort and disease. Daily life in the trenches was governed by commanding officers. Troops in trench warfare were sedentary, which made holding soldiers accountable for their duties easier than if they were on the march.
Discipline in the trenches was ingrained through the daily schedule. Each morning before sunrise, soldiers would awaken and guard their trench with bayonets against a morning raid by the enemy. This event was called the morning "stand to." This was followed by the "morning hate," during which each side would fire the first rounds of the morning, releasing the tension of waiting for the fight. The "morning hate" was followed by rifle cleaning, breakfast, inspection by officers and chore assignment.
Soldiers were assigned a chore by the commander and reported for that duty for the day. Meals were eaten when time allowed, and leisure wasn't allowed until nightfall when movement would be less noticeable to the opposition. The strict schedule and supervision by higher officers prevented soldiers from misbehaving in the trenches.