Metronidazole (MTD) is an antibiotic that is commonly used to treat pathogens and protozoal infections, which have a highly harmful impact on human health and domestic animals. Hence, the detection of MTD is highly necessary to avoid environmental pollution. The hydrothermal technique has been utilized to prepare Nickel Tungsten oxide (NiWO4) nanosheets which were anchored with the carbon nanofiber (CNF) to produce CNF/NiWO4 nanocomposite, the nanocomposite coated on the glassy carbon electrode (GCE) and applied to the electrochemical detection of MTD. Besides, field emission scanning electron microscope (FESEM), transmission electron microscope (TEM), energy dispersive X-ray analysis (EIS), Fourier-transform infrared spectroscopy (FTIR), X-ray diffraction analysis (XRD), and X-ray photoelectron spectroscopy. Moreover, electrochemical impedance spectroscopy (EIS), cyclic voltammetry studies (CV), and differential pulse voltammetry (DPV) were also handled for the identification of the electrochemical behavior of the GCE/CNF/NiWO4 electrode responses. Finally, the CNF/NiWO4 electrode shows a low detection limit of 0.4 μM, a wide linear response range of 0.01-650 µM, and a higher sensitivity of 0.274 μA μM−1 cm−2, with better repeatability, reproducibility, and excellent stability. Finally, the prepared GCE/CNF/NiWO4 electrodes were employed to detect MTD in tap water and urine samples with acceptable recoveries.