World War I used a form of warfare called trench warfare
Both sides dug long trenches facing one another. This protected them from rifle and machinegun fire, but not from shells.
The men spent most of their time in the trenches, coming out at dusk and dawn for raids and attacks.
The men stood guard, ate and slept in their trenches. In winter the trenches filled with water. There were rats and disease everywhere.