Heterojunction nanocomposites (ZnO:NiO:CuO) were synthesized via a hydrothermal method and annealed at three different temperatures (400 °C, 600 °C, and 800 °C). The structural, optical, and electrical properties were examined by employing XRD, SEM, UV–Vis, FTIR, and LCR meter techniques to investigate the effects of annealing. Increasing the annealing temperature resulted in the nanocomposites (NCPs) exhibiting enhanced crystallinity, purity, optical properties, and improved electrical and dielectric behavior. The calculated crystalline sizes (Debye-Scherrer method) of the NCPs were determined to be 21, 26 and 34 nm for annealing temperature 400 °C, 600 °C, and 800 °C, respectively. The calculated bandgaps of synthesized samples were found in the range of 2.92-2.55 eV. This temperature-dependent annealing process notably influenced particle size, morphology, band-gap characteristics, and photocatalytic efficiency. EDX analysis affirmed the sample purity, with elemental peaks of Zn, Cu, Ni, and O. These NCPs demonstrated exceptional photocatalytic activity against various dyes solutions (Methyl orange (MO), Methylene Blue (MB), and mixed solution of dyes) under sunlight and also showed good antibacterial properties assessed by the disc diffusion method. Notably, the nanocomposite annealed at 400 °C exhibited a particularly high degradation efficiency by degrading 96% MB and 91% MO in just 90 min under sunlight.