  Recently Oh-Thomas constructed a virtual cycle $[X]^{\mathrm{vir}}\in A_*(X)$
for a quasi-projective moduli space $X$ of stable sheaves or complexes over a
Calabi-Yau 4-fold against which DT4 invariants may be defined as integrals of
cohomology classes. In this paper, we prove that the virtual cycle localizes to
the zero locus $X(\sigma)$ of an isotropic cosection $\sigma$ of the
obstruction sheaf $Ob_X$ of $X$ and construct a localized virtual cycle
$[X]^{\mathrm{vir}}_{\mathrm{loc}}\in A_*(X(\sigma))$. This is achieved by
further localizing the Oh-Thomas class which localizes Edidin-Graham's square
root Euler class of a special orthogonal bundle. When the cosection $\sigma$ is
surjective so that the virtual cycle vanishes, we construct a reduced virtual
cycle $[X]^{\mathrm{vir}}_{\mathrm{red}}$. As an application, we prove DT4
vanishing results for hyperk\"ahler 4-folds. All these results hold for virtual
structure sheaves and K-theoretic DT4 invariants.
