I'm reading Complex Geometry-an introduction by Daniel Huybrechts. In section 2.3, he gives a group homomorphism $\mathcal{O}: \operatorname{Div}(X)\to \operatorname{Pic}(X)$, and he proves that for any effective divisor $D\in \operatorname{Div}(X)$, there exists a nonzero global section $s$ of $\mathcal{O}(Y)$ such that $Z(s)=D$.
Now let $Y$ be a irreducible hypersurface, then the section $s\in H^0(X,\mathcal{O}(Y))$ with $Z(s)=Y$ gives rise to a sheaf homomorphism $\mathcal{O}(X)\to \mathcal{O}(Y)$ and dually to $\mathcal{O}(-Y)\to \mathcal{O}_X$. I think that this two homomorphisms are $f\mapsto fs$ and $t^*\mapsto t^*(S)$ locally.
Then he gives Lemma 2.3.22:
Lemma 2.3.22 The induced map $\mathcal{O}(-Y) \rightarrow \mathcal{O}_X$ is injective and the image is the ideal sheaf $\mathcal{I}$ of $Y \subset X$ of holomorphic functions vanishing on $Y$.
In the proof, he says that locally the map is given by multiplication with the equation defining $Y$. I can't understand this claim and why it's injective.
I explain the statement "locally the map is given my multiplication". Locally means you reduce to an affine neighbourhood looking like $X=\mathbf{C}^n$. Then $Y$ is defined (locally) by regular holomorphic function $f \in \mathcal{O}_X$. Now $f$ defines a sheaf of ideals $(f)\subset \mathcal{O}_X$. Then the map is $\mathcal{O}(-Y) \rightarrow \mathcal{O}_X$ is just the inclusion $ f\mathcal{O}_X=(f)\hookrightarrow \mathcal{O}_X$.
Edit. If $D$ is an effective divisor locally given by a regular $f$, its associated line bundle $\mathcal{O}(Y)$ is by definition locally generated by elements of the form $f^{-1}$! So sections of this bundle might have poles! However, the dual bundle $\mathcal{O}(-Y)$ is generated by the functions $f$, which have only zeros, no poles, and obviously define the ideal in $\mathcal{O}_X$.
This is essentially explained quite well here on wikipedia.