The aggravating extreme climate changes and environmental pollution problems have stimulated the exploration of green alternatives to conventional fossil fuels and green environmental treatments. Photocatalysis is recognized as an outstanding green tool for solving the energy crisis and environmental rehabilitation issues. Restricted by the high cost of precious metals, researchers expect to obtain low-cost, efficient and stable photocatalysts. Herein, CdS materials were derived through MOFs and subsequently combined with CoO to form CdS/CoO heterojunctions. The catalytic ability was evaluated by the photocatalytic degradation of tetracycline hydrochloride (TC) and the photocatalytic production of hydrogen. With the integration of CoO, in terms of TC degradation, CdS/CoO heterojunctions can degrade over 90% of TC within 1 hour. In terms of hydrogen production, compared to CdS alone, the hydrogen production efficiency of the CdS/CoO heterojunction increased by 1.7 times. The initial analysis of the reasons for the enhancement of photocatalytic efficiency was conducted by TEM, XPS and other characterization means. Density functional theory (DFT) calculations verified the existence of a built-in electric field in the CdS/CoO heterojunction, which was the essential reason for the improved catalytic performance, and finally, the presence of ˙O2- and ˙OH in the photocatalytic system was demonstrated by the ESR technique. Based on the carrier separation/transfer pathway in the heterojunction, a simple and novel S-type heterojunction scheme was proposed.