Let $\mathcal{F}$ be a locally free sheaf of rank $n$ on an $n$ dimensional complex manifold $X$. If the zero locus of a generic global section of $\mathcal{F}$ is $0$ dimensional, then its cycle class is equal to $c_n(\mathcal{F})$. What can be said if the generic section has a zero locus of positive dimension?
Let $V = H^0(X,\mathcal{F})$ be the space of global sections of $\mathcal{F}$ and let $$ V \otimes \mathcal{O}_X \to \mathcal{F} $$ be the evaluation morphism. If it is surjective (i.e., $\mathcal{F}$ is globally generated), then the zero locus of a general section is zerodimensional, and has class $c_n(\mathcal{F})$.
So, assume that the evaluation map is not surjective. Assume, moreover, it has a constant rank, so that its image $\mathcal{F}' \subset \mathcal{F}$ is a vector subbundle of rank $r$. Then any global section of $\mathcal{F}$ comes from a global section of a globally generated vector bundle $\mathcal{F}'$, and their zero loci coincide. Therefore, the class of the zero locus of a general section of $\mathcal{F}$ is equal to $c_r(\mathcal{F}')$.
When the rank of the evaluation morphism is nonconstant, the class of a general zero locus is not so easy to find. To sketch a possible approach, one can first blowup $X$ in such a way that the rank is constant on the blowup, and then pushforward $c_r(\mathcal{F}')$ with respect to this map.
Assume the zero locus has positive dimension, but is smooth (or is, at least, locally complete intersection). Then it comes with a vector bundle (socalled "excess intersection" bundle), whose top Chern class equals $c_n(\mathcal{F})$.
For instance, if the original section is just zero, its zero locus is the whole $X$, and the excess intersection bundle is $\mathcal{F}$.

$\begingroup$ Thanks for your answer. I was hoping there is a way to find the cycle of the zero locus using some chern class. Is this possible? $\endgroup$ – user2520938 May 21 '18 at 8:03

$\begingroup$ What do you mean? There are many possibilities (one of them is $X$ itself). For instance, imagine that your vector bundle is a sum of line bundles. Then you can take several components of your section to be zero, and the other components general. In this way you will get a general complete intersection of intermediate multidegree as the zero locus. $\endgroup$ – Sasha May 21 '18 at 8:21

$\begingroup$ I was hoping that for generic choices the cycle is welldefined, is this not the case? $\endgroup$ – user2520938 May 21 '18 at 8:25

$\begingroup$ @user2520938: Sorry, I misread your question. See below another answer. $\endgroup$ – Sasha May 21 '18 at 9:23