Diarrhea remains one of the leading causes of mortality and morbidity, despite the global progression of eradicating the burden of diarrhea-related morbidity and mortality in the past two decades. In Sub-Saharan African (SSA) countries, there is inadequate supply and sanitation of safe water. However, there is a lack of literature that estimates the impact of drinking water and sanitation service on childhood diarrhea in Kersa Demographic and Health Surveillance. Therefore, the current study aimed to assess the prevalence and effect of water supply and environmental sanitation on diarrhea among under-five children from 2017 to 2021 in Kersa Demographic and Health Surveillance, Eastern Ethiopia. A prospective cohort study design was implemented among 6,261 children from the Kersa Health Demographic Surveillance System (HDSS), Eastern Ethiopia, from 1 January 2016 to 31 December 2021. STATA statistical software was used to extract data from the datasets. The binary logistic regression was used to identify the impact of water supply and environmental sanitation on diarrhea by controlling important confounders. The adjusted odds ratio (AOR) with a 95% confidence interval measures this association. The current study showed that among 6,261 under-five children, 41.75% of them had developed active diarrhea during the follow-up time. The final model depicted that having media exposure of 22% [AOR - 0.78 CI: (0.61, 0.98)], a protected tube well source of drinking water of 50% [AOR - 1.50, CI: (1.32, 1.71)], unprotected tube well source of drinking water of 66% [AOR - 1.66 CI: (1.27, 2.18)], having toilet facility of 13% [AOR - 0.87 CI: (0.78, 0.97)], and accessibility of source of water [AOR - 1.17 CI: (1.05, 1.30)] showed a significant association with diarrhea among under-five children. The prevalence of diarrhea is found to be high in the Kersa District. The main predictors of diarrhea under five were a lack of latrines, an unimproved source of drinking water, and a distance from access to drinking water. The study setting should focus on increasing the adequacy of safe drinking water and sanitation.