Heterostructures based on layered materials are considered next-generation photocatalysts due to their unique mechanical, physical, and chemical properties. In this work, we conducted a systematic first-principles study on the structure, stability, and electronic properties of a 2D monolayer WSe2/Cs4AgBiBr8heterostructure. We found that the heterostructure is not only a type-II heterostructure with a high optical absorption coefficient, but also shows better optoelectronic properties, changing from an indirect bandgap semiconductor (about 1.70 eV) to a direct bandgap semiconductor (about 1.23 eV) by introducing an appropriate Se vacancy. Moreover, we investigated the stability of the heterostructure with Se atomic vacancy in different positions and found that the heterostructure was more stable when the Se vacancy is near the vertical direction of the upper Br atoms from the 2D double perovskite layer. The insightful understanding of WSe2/Cs4AgBiBr8heterostructure and the defect engineering will offer useful strategies to design superior layered photodetectors.