Let $X$ be a scheme. We'll assume it's noetherian to avoid any pathologies. Let $D$ be an effective Cartier divisor on $X$. I am having trouble understanding how to go between the language of invertible sheaves, ideal sheaves, and effective Cartier divisors. I want to be able to go between the following two ideas:
An effective Cartier divisor as a pair $(\mathcal{L}, s)$ where $\mathcal{L}$ is an invertible sheaf and $s$ is a regular section (i.e a section $s \in \Gamma(X, \mathcal{L})$ whose corresponding morphism $\mathcal{O}_{X} \longrightarrow \mathcal{L}$ is injective).
An effective divisor as a sheaf of ideals ${I}_{D} \subseteq \mathcal{O}_{X}$ which is locally generated by a single non-zerodivisor.
I know these two sheaves should be inverses of eachother. In particular, beginning with an ideal sheaf $\mathscr{I}_{D}$ as in (2), considering the dual $\mathscr{Hom}_{\mathcal{O}_{X}}(\mathscr{I}_{D}, \mathcal{O}_{X})$, we have an obvious choice for a regular section which is just given by the inclusion $\mathscr{I}_{D} \hookrightarrow \mathcal{O}_{X}$.
However, I am not as comfortable going from (1) to (2). Given an invertible sheaf and regular section $(\mathcal{L}, s)$, I want to define a sheaf of ideals $\mathscr{Hom}_{\mathcal{O}_{X}}(\mathcal{L}, \mathcal{O}_{X})$. The problem is I don't see any obvious way to realise this as a subsheaf of $\mathcal{O}_{X}$.
The obvious choice is to define a morphism $\mathscr{Hom}_{\mathcal{O}_{X}}(\mathcal{L}, \mathcal{O}_{X}) \rightarrow \mathcal{O}_{X}$ by evaluation at the section $s$ of $\mathcal{L}$ but I see no reason that morphism should be injective.
Is there any way to see this easily so I can translate between the two ideas?