Let $X$ be a scheme. By definition, a Cartier divisor $D$ is a global section of the sheaf $\mathcal{M}_X^{\times}/\mathcal{O}_X^{\times}$, where $\mathcal{M}_X^{\times}$ is the sheaf of multiplicative units of the sheaf of rational functions. This in turn is equivalent to the data of a cover $\{ U_i\}$ of $X$ together with sections $f_i \in \mathcal{M}_X^{\times}$, that is, $f_i = g_i/h_i$ for nonzero divisors $g_i, h_i \in \mathcal{O}_X(U_i)$.
I want to use this data to construct an invertible sheaf $\mathcal{L}$ from a Cartier divisor $D$.
This is part of an exercise that is proving to be too hard, so hints rather than answers would be appreciated. Thank you in advance.