The use of natural, eco-friendly coagulant-flocculants in wastewater treatment can help to reduce suspended particles in a way that includes less exhaustible materials with minimal adverse effects on the environment. Hence, this study is to investigate raw diatomaceous earth (diatomite) as a sustainable ecological coagulant to reduce colloids and suspended matter in wastewater and optimize the coagulation process parameters to improve efficiency, save energy consumption, and reduce costs in the urban sewage treatment plants. The Box-Behnken response surface design was applied to model the individual and combined interactions between four variable factors (initial pH, coagulant dose, coagulation speed, and coagulation time) and their effect on turbidity removal efficiency and final pH of water. Results showed that diatomite has excellent efficiency in reducing the turbidity of wastewater; Elimination reached a maximum of 85.74%. The optimal operating conditions for reducing energy consumption and cost of the operation while improving turbidity removal effectiveness and achieving a neutral final pH to avoid a post-adjustment are an initial pH of 7, a dose of diatomite of 0.5 g/L of effluent, and a coagulation speed of 100 rpm for 3 min. It results in 72.6% turbidity removal and a pH of 7.27. diatomaceous earth shows very usefully for reducing the turbidity of the sewage in the urban wastewater treatment plant.