Pharmaceuticals are characterized by a wide range of physical, chemical, and biological properties and functionalities that contribute to their inherent complexity as compounds. Unfortunately, human carelessness during the production, use, and disposal of these compounds results in their presence in the environment. This study utilized a nanostructured TiO2 film on a glass ring at the bottom of a reactor and simulated a solar radiation lamp as the radiation source for both photocatalytic and photolytic experiments, with the aim of unraveling the mechanism behind the degradation of trimethoprim (TMP), a pharmaceutical compound. This approach provides a novel perspective on the role of TiO2 in the degradation of pharmaceuticals and could pave the way for more efficient and sustainable wastewater treatment methods. Scavenger studies were carried out using isopropanol, ammonium oxalate, and triethanolamine to examine the photocatalytic mechanism. Isopropanol and triethanolamine were found to impede the photocatalytic degradation of TMP, highlighting the significance of hydroxyl radicals and positive holes in the degradation process, while no inhibition was observed in the presence of ammonium oxalate. The complete degradation of TMP through photocatalysis under simulated solar radiation was observed in ultra-pure water in fewer than 3 h, as indicated by the results. Our findings suggest that utilizing natural solar radiation as a source of UV-A radiation in reactor configurations based on this approach holds promise for cost-effective pharmaceutical degradation treatment in wastewater treatment plants. The practical potential of this approach is supported by the results obtained under simulated solar radiation with an irradiation intensity in the UV-A region of 33 ± 2 W/m2.