In this study, direct thermal polycondensation, hydrothermal, and ultrasonic techniques were used to fabricate photocatalysts consisting of bare g-C3N4 (GCN), h-MoO3 (MoO3), MoO3/g-C3N4 (MGCN), and MoO3/Ag/g-C3N4 (MAGCN) composites. These methods were used to improve the photocatalytic effect, especially for environmental applications. The surface and chemical properties of the fabricated samples were investigated by XRD, FT-IR, FE-SEM, HR-TEM, UV-DRS, XPS, and PL analysis. Bare and composite photocatalysts were tested for photodegradation of the methylene blue (MB) dye and tetracycline (TC) antibiotic under solar irradiation. The MAGCN composite material exhibits remarkable efficiency in degrading 99% of MB dye and 90% of TC antibiotic within a time frame of 60 min when exposed to sunlight irradiation. The degradation rate constants (k) of MB and TC in the most active MAGCN photocatalyst were 11.02 and 7.03 times higher than those of pristine GCN, respectively. The scavenger reaction shows that the most important reactive species in the photocatalytic process are superoxide and photogenerated holes. The outstanding photocatalytic efficiency of the MAGCN catalyst was demonstrated by the fact that Ag nanoparticles act as mediators of fast charge transfer, resulting in higher absorption of sunlight, enhanced charge separation/transfer, and regeneration by MoO3 and GCN. The MAGCN photocatalyst exhibits remarkable activity, maintains its performance over six consecutive reaction cycles, and exhibits excellent stability and reusability. Intermediates were analyzed by GC-MS, and suitable degradation pathways were proposed. These results enable the development of an effective Z-scheme heterojunction photocatalyst and facilitate its wide application in the degradation of organic pollutants in wastewater.