I cannot quite understand Hatshorne's wording in the Cartier divisor of zero, which is given as follows.

I would like to have some further explanation over the definition and ananalogy in terms of Weil divisor. Base on this definition, I cannot quite follow the proof of one of the statements in Proposition 7.7. Which is:
Explicitly, I cannot understand why the given $f$ will satisfy the desired property. Namely, why the divisor of zero of $f$ is $D$.
Thank you very much in advance for your explanation.
------Edited 17/10/2019------------
I now have a more explicit idea on what I would like to ask.
My question's still surrounding 7.7 (b). I perfectly understand by linear equivalence, we can write
$$D=D_0+(f)$$
and $f$ will define a global section $s\in\Gamma(X,\mathscr{L})$. By result of (a), the divisor of zero of $s$, $(s)_0=D_1$, where $D_1$ is certain effective Cartier divisor.
Now, my question is: How can I show $D=D_1$, the exact equivalence?

Now Apparently I have an idea. $D=D_0+(f)$ gives the linear equivalence of divisors and $f$ define a global section $s\in\Gamma(X,\mathscr{L})$ as mentioned in the first statement of the proof of (b).
What's missing is just the isomorphism to $\mathscr{O}_{U_i}$, which actually had been defined (a) to be a morphism $\varphi$ gluing the set $\{\varphi_i:f\in\Gamma(X,\mathscr{L})\mapsto ff_i\in\Gamma(X,\mathscr{O}_{U_i})\}$.
It will be great if someone can say a word on whether my idea is going in the right direction :).