As the concept of green development spreads worldwide, environmental protection awareness for production and life has been continuously strengthened. Antibiotic residues in aquaculture wastewaters aggravate environmental pollution and threaten human health. Therefore, the detection of residual antibiotics in wastewater is crucial. In this paper, a new, simple, and low-cost method based on the glassy carbon electrode electrochemical sensor for the detection of sulfadiazine in aquaculture wastewater was developed without using complex materials to modify the electrode surface, to detect sulfadiazine which electrochemically oxidizes directly. The electrochemical performance of the sensor was studied and optimized with differential pulse voltammetry and cyclic voltammetry in the three-electrode system. The optimal electrolyte was acetic acid-sodium acetate buffer, and the optimal pH was 4.0. Finally, based on the optimized conditions, the newly established method showed satisfactory results for detecting sulfadiazine in aquaculture wastewater. The concentration of sulfadiazine and the peak current intensity showed a linear relationship in the range of 20 to 300 μmol/L, and the limit of detection was 6.14 μmol/L, the recovery rate of standard addition was 87–95%, with satisfactory reproducibility and low interference.