Water pollution has posed a serious threat to the environment and human health. There is an urgent need to develop highly efficient and application-convenient photocatalytic materials. To overcome this critical problem, the carbonized nickel-loaded spent coffee grounds modified BiOCl (CNSCG-BOC-8) photocatalyst is prepared by using facile calcination and hydrolysis method. The optimum substrate carbonization temperature, the amount of substrate, and the loading amount of nickel ion are discussed. Further, the photocatalytic performance of the catalyst is tested using Ofloxacin (OFX) as target pollutant under ultraviolet and visible light (UV-vis light). The as-obtained photocatalysts show the degradation efficiency of OFX in the prepared composite reaches 87% within 40 min under ultraviolet and visible light. Moreover, the results show that CNSCG-BOC-8 has better photoelectricity, excellent cycle stability, and is environment-friendly. Therefore, this paper provides an important reference for the rational development and use of Ni-loaded biomass-derived carbon as the substrate to modify bismuth-based photocatalyst for environmental remediation.