Dyes are toxic organic compounds released as effluent from various industries that need proper treatment as they pose serious hazards to the environment and living beings, including humans. Nanocomposites can be employed as photocatalysts for the elimination of such organic compounds from wastewater. One such attempt is made in this present research study, where a zinc-based nanocomposite has been fabricated for the elimination of the methylene blue dye (MB). For the development of nanocomposite, zinc oxide nanoparticles (ZnONPs) were prepared to utilize Allium sativa peel (garlic skin) extract, which was further processed to develop ZnO/kaolin clay NC. ZnONPs and ZnO/kaolin clay NC formation have been confirmed by UV–Vis spectral bands at 379 nm and 423 nm. The NC was rod-shaped, with width of 60–100 nm and length of 200–800 nm and an average size of 50.0 ± 0.58 nm. Both materials were compared for their efficacy in photocatalytic degradation of the MB under solar light irradiation. ZnONPs removed 65% of MB, whereas the degradation efficiency of ZnO/clay NC was calculated to be 96% for 10 ppm MB. A kinetics study for photocatalytic degradation of MB using both nanomaterials showed that the photocatalytic degradation followed the pseudo-first-order (PFO) type of reaction. This investigation represents an expeditious, lucrative, ecological, and appropriate technique for the fabrication of functional nanomaterials for the remediation of diverse organic pollutants.