[proofplan]
We choose local holomorphic equations for the effective Cartier divisor $D$ and use the same functions as local representatives of the section. The transition functions of $\mathcal O(D)$ are arranged so that these local representatives satisfy the section gluing rule on overlaps. Since the local representatives are precisely the local defining functions of $D$, their vanishing orders recover the coefficients of $D$.
[/proofplan]
custom_env
admin
[step:Choose holomorphic local equations for the effective divisor]
Because $D$ is an effective Cartier divisor, there is an open cover $(U_i)_{i \in I}$ of $X$ and, for each $i \in I$, a [holomorphic function](/page/Holomorphic%20Function)
\begin{align*}
f_i: U_i \to \mathbb C
\end{align*}
which is not identically zero on any connected component of $U_i$ and satisfies
\begin{align*}
D|_{U_i}=\operatorname{div}(f_i).
\end{align*}
For every pair $i,j \in I$, define
\begin{align*}
g_{ij}: U_i \cap U_j \to \mathbb C^\times, \qquad g_{ij}=\frac{f_i}{f_j}.
\end{align*}
Since $f_i$ and $f_j$ define the same Cartier divisor on $U_i \cap U_j$, their quotient is a nowhere-vanishing holomorphic function on $U_i \cap U_j$. These functions are the transition functions defining $\mathcal O(D)$ under the convention in the statement.
[/step]
custom_env
admin
[step:Glue the local defining equations into a global section]For each $i \in I$, let
\begin{align*}
\sigma_i: U_i \to \mathbb C, \qquad \sigma_i=f_i
\end{align*}
be the local representative of the desired section in the trivialization of $\mathcal O(D)$ over $U_i$. On an overlap $U_i \cap U_j$, we have
\begin{align*}
\sigma_i=f_i=\frac{f_i}{f_j}f_j=g_{ij}\sigma_j.
\end{align*}
Thus the family $(\sigma_i)_{i \in I}$ satisfies the gluing rule for sections of the line bundle with transition functions $(g_{ij})_{i,j \in I}$. Therefore it determines a global holomorphic section
\begin{align*}
s_D \in H^0(X,\mathcal O(D)).
\end{align*}[/step]
custom_env
admin
[guided]The construction is local first and global second. In the chosen trivialization of $\mathcal O(D)$ over $U_i$, a section is represented by a holomorphic function on $U_i$. We define that local representative to be the local equation of the divisor:
\begin{align*}
\sigma_i: U_i \to \mathbb C, \qquad \sigma_i=f_i.
\end{align*}
To prove that these local functions define one global section, we must check the compatibility condition on every overlap. The transition function from the $j$-trivialization to the $i$-trivialization is
\begin{align*}
g_{ij}: U_i \cap U_j \to \mathbb C^\times, \qquad g_{ij}=\frac{f_i}{f_j}.
\end{align*}
Therefore, on $U_i \cap U_j$,
\begin{align*}
g_{ij}\sigma_j=\frac{f_i}{f_j}f_j=f_i=\sigma_i.
\end{align*}
This is exactly the section gluing rule for the line bundle $\mathcal O(D)$ with these transition functions. Since each $\sigma_i=f_i$ is holomorphic on $U_i$, the glued section is holomorphic. Hence the family $(\sigma_i)_{i \in I}$ defines a global section
\begin{align*}
s_D \in H^0(X,\mathcal O(D)).
\end{align*}[/guided]
custom_env
admin
[step:Compute the divisor of the glued section locally]
The divisor of a holomorphic section of a line bundle is computed in any local holomorphic trivialization by taking the divisor of its local representative. On $U_i$, the section $s_D$ is represented by $\sigma_i=f_i$, hence
\begin{align*}
\operatorname{div}(s_D)|_{U_i}=\operatorname{div}(f_i)=D|_{U_i}.
\end{align*}
Since the open sets $(U_i)_{i \in I}$ cover $X$, the local equalities glue to the global equality
\begin{align*}
\operatorname{div}(s_D)=D.
\end{align*}
Thus $\mathcal O(D)$ has the claimed distinguished holomorphic section.
[/step]