In this work, magnetic activated carbon (MGAC) was investigated to remove the antibiotic cefazolin from aqueous solutions as well as its antibacterial properties. To determine the optimal process conditions and achieve maximum efficiency, the effect of temperature, contact time, initial concentration of the drug, composite dosage, and pH using the response surface method (RSM) and the central composite design model (CCD) were investigated by DOE software. Structural characteristics and morphology of the nanocomposite were analyzed by using FTIR, XRD, EDAX, SEM, TEM, BET, TGA, VSM, analyzes. The results showed that pH = 6, the temperature of 30 ℃, contact time 150 minutes, initial concentration of drug 20 mg/l, and composite dosage 0.03 g were the best conditions for removing cefazolin from aqueous solution. In these conditions, the magnetically activated carbon was able to remove 96% of cefazolin. The Langmuir, Freundlich, and Temkin isotherms were also studied and the results showed that the absorption behavior is most consistent with the Temkin isotherm. The results of thermodynamic experiments also showed that the adsorption process is exothermic and spontaneous. Finally, the antibacterial properties of the prepared nano composite on Streptococcus and Salmonella were investigated and the results showed that the prepared sample has antibacterial properties.