Any complex curve in a complex surface is the zero set of some holomorphic section of a holomorphic line bundle Let $Y$ be a closed complex surface, $L\to Y$ be a holomorphic line bundle, $\sigma:Y\to L$ a holomorphic section, and $B\subset Y$ the zero set of $\sigma$. If the first Chern class $c_1(L)$ of $L$ is divisible by some integer $n\geq 2$, it is known that there is a $n$-fold covering $X\to Y$ branched along $B$ ($X$ may have singular points).
What I am curious is the following question: Is any complex curve embedded in $Y$, or more generally any (complex) codimension 1 analytic subvariety in $Y$ the zero set of some holomorphic section of a holomorphic line bundle over $Y$?
 A: Yes. This is known as the divisor - line bundle correspondence, see section 2.3 of Huybrechts' Complex Geometry: An Introduction for example.
A divisor in a complex manifold $Y$ is a locally finite, formal, integral linear combination of irreducible hypersurfaces of $Y$. That is, a divisor takes the form $\sum_Z \eta_ZZ$ where $\eta_Z \in \mathbb{Z}$, the sum is taken over all irreducible hypersurfaces $Z \subset Y$, and the collection $\{Z \mid \eta_Z \neq 0\}$ is locally finite. We say a divisor is effective if $\eta_Z \geq 0$ for all $Z$. An analytic subvariety of codimension one is therefore an example of an effective divisor.
On a complex manifold, one can construct a holomorphic line bundle $\mathcal{O}(D)$ associated to a divisor $D$, which admits a meromorphic section $\sigma$ whose associated divisor is $D$. If the divisor was effective, then the section $\sigma$ is actually holomorphic. In particular, the line bundle associated to an analytic subvariety $Z$ of codimension one admits a holomorphic section $\sigma$ such that $\sigma^{-1}(0) = Z$.

Beyond complex manifolds, you must be careful. There are two notions of divisors in algebraic geometry, namely Weil and Cartier; they do not coincide in general. The definition of divisor I gave above is actually the definition of a Weil divisor, while the notion of Cartier divisors is the one which gives rise to holomorphic line bundles with sections.
