The enhancement of methane production is crucial in increasing the self-sufficiency of wastewater treatment plants, and anaerobic digestion (AD) is considered the sustainability driver as it serves as the energy recovery unit. Artificial intelligence techniques provide a way to control the process of AD without requiring knowledge of its nature. The purpose of this study is to examine the use of artificial neural network (ANN) to model the digesters in the wastewater treatment plant in Konya, Türkiye, and to optimize the methane yield and hydrogen sulfide concentration. The constructed model is based on 11 parameters as input features, whereas methane yield and hydrogen sulfide serve as output. The study analyzes the sensitivity of input parameters on output parameters using the ANN model. It utilizes the genetic algorithm to determine the optimal values of input parameters that maximize methane production and minimize hydrogen sulfide. The proposed model was evaluated using the mean-square error (MSE) and correlation coefficient (R) for both training and test sets. The results indicate that the MSE and R are 0.96, 0.94, 0.0048, and 0.0077, respectively. The sensitivity analysis shows that the pH level of thickened sludge has the greatest impact on both outputs. Conversely, the sludge flow rate has the lowest impact on methane, while the volatile fatty acid of the digester has the lowest impact on hydrogen sulfide. Moreover, multiple optimal solutions can maximize methane gas and minimize hydrogen sulfide. Methane yield can be increased up to 27%, with corresponding hydrogen sulfide of 350 ppm.