This article reports the hot issue of water pollution imputable to organic dyes from the textile industry and drugs from the pharmaceutical industry. A simple and facile co-precipitation route is adopted to fabricate copper, terbium co-doped magnesium ferrite (CTMF). The composite with MXene (CTMF@MXene) is fabricated via ultrasonication route. Cell parameters, hopping length, crystallite size, and x-ray density of ferrites are calculated by XRD. Crystallite size decreased on doping while unit cell length and volume increase due to expansion in cell volume owing to the replacement of Mg2+ , Fe3+ ions by Cu2+, Tb3+. UV-visible spectroscopy is supported to examine all optical properties like absorption, band gap, refractive index, extinction coefficient, and urbach energy. Direct band gap decreases from 2.2 to 1.72 eV on co-doping while the refractive index, extinction coefficient, urbach energy, and dielectric constant increase due to increased crystal defects and electrical properties. Crystal defects introduce exceptional charge carriers and create localized energy states within the band gap that can trap charge carriers and affect their recombination rate. These defects act as scattering centers affecting the mobility of charge carriers. CTMF@MXene displays the highest photocatalytic efficiency against congo red (CR) (97%), crystal violet (CV) (95%), and diclofenac sodium (DS) (86%). This improved photocatalytic result and enhanced optical and surface properties can be attributed to the synergistic effect of Cu, Tb co-doping, and MXene as a composite material on the properties of magnesium ferrite.