© 2022 American Chemical Society. All rights reserved.In this period when environmental pollution has become uncontrollable, the removal of drug active substances reaching the environment and the analysis of drug active substances in different matrix environments are important for both living life and a sustainable environment. Therefore, the production of multifunctional materials that can be used in these two different processes has gained importance in the literature. Based on this thought, in this study, a g-C3N4@TiO2@Fe3O4multifunctional nanohybrid material was synthesized and used for magnetic solid-phase extraction (MSPE) and photocatalytic degradation of trimethoprim and isoniazid, used together in tuberculosis treatment. All analyses were performed by high-performance liquid chromatography using a diode-array detection (HPLC-DAD) system. The synthesized material was characterized by X-ray diffraction spectroscopy (XRD), Raman spectroscopy, Fourier transform infrared (FTIR) spectroscopy, Brunauer-Emmett-Teller (BET) method, ζ-potential analysis, field-emission scanning electron microscopy (FE-SEM), and energy-dispersive X-ray spectroscopy (EDX). Important analytical parameters for the MSPE method such as the pH value of the sample solution, the volume of the sample solution, the amount of the sorbent, the type and volume of the elution solvent, and extraction time were optimized. The optimized MSPE method was then applied to different environmental waters and pharmaceutical samples. The recovery percentages for these samples were found to be between 95 and 107%. For trimethoprim and isoniazid, the limit of detections (LODs) were 0.055 and 0.145 and the limit of quantifications (LOQs) were 0.167 and 0.439 ng·mL-1, respectively. It was observed that ∼100% of trimethoprim and isoniazid active components were photocatalytically removed from the g-C3N4@TiO2@Fe3O4nanohybrid material in ∼120 min under UV light.