It is necessary to construct photocatalytic heterojunctions with high efficiency to remove bacteria and antibiotics from polluted water. To achieve this goal, by selecting Bi4O5I2 with narrow band gap and BiOCl with wide band gap, a novel Bi4O5I2/BiOCl heterojunction was constructed by a simple precipitation method. Various characterizations including XRD, TEM and XPS confirmed that the Bi4O5I2/BiOCl heterojunction was successfully synthesized. The optimum sample 30% Bi4O5I2/BiOCl can inactivate Escherichia coli (E. coli) in 30 min, Staphylococcus aureus (S. aureus) in 75 min and degrade 76% tetracycline (TC) in 60 min in LED light. To further study the performance of the photocatalyst, the photocatalyst was tested in sunlight. It was found 30% Bi4O5I2/BiOCl could inactivate E. coli in 6 min, S. aureus in 15 min and degrade 84% TC in 60 min under sunlight, realizing a shorter reaction time and a better degradation efficiency. Photocurrent and electrochemical impedance tests (EIS) results confirmed higher electron hole separation efficiency in composites. The mechanism of removing pollutants under LED light and sunlight was verified by their respective capture experiments. This experiment provides a new possibility for the application of photocatalysts in a variety of light sources.