Why are effective divisors the same thing as curves on $X$? In Vakil's FOAG, Chapter $20$, he starts section $20.2$ by writing

Let $X$ be a regular projective surface, and $C$ and $D$ be effective divisors (i.e., curves) on $X$ ...

My question is, why are effective divisors on $X$ the same thing as curves on $X$? I understand that divisors, up to linear equivalence, are the same as invertible sheaves because $Pic(X)$ is isomorphic to $Cl(X)$, and I understand that invertible ideal sheaves on $X$ are the same as effective cartier divisors, which are the same as curves on $X$ because these are closed subschemes $Y\hookrightarrow X$ cut out locally by one non-zero-divisor, so in particular $\dim Y=1$, i.e. $Y$ is a curve. It seems just a few more logical steps should give the correspondence Vakil uses here, but I don't see it immediately. It's probably been covered prior in the book, but I've skipped around sections a bit and must have missed it.
 A: The ambiguity detected is between curves and reduced curves. The line $2L$ in $\mathbb{A}^2$ is the same set as $L$, but "considered with multiplicity $2$". We could just consider that to be a psychological state on the part of the reader, or a device in calculating—so that we can multiply $2L$ by a different curve $C$ and get number $2(C.L)$.
However, the ideal $(x^2)$ is not the same as $(x)$. In scheme theory, we want to take $2L$ to be the set $L$, but with coordinate ring$$\mathbb{C}[x, y]/(x^2).$$"Functions on $2L$" then include the function $x$ which takes the value $0$ at every point, but has nonzero derivative in the transverse direction to $L$ in $\mathbb{A}^2$.
An effective divisor is$$D = \sum n_i C_i.$$If we only look at the point set, we do not see the $n_i$. We might want to consider the $n_i$ as artificially added multiplicities, for example to make Bézout's theorem work. Or we might want to consider $D$ with its coordinate ring$$\mathbb{C}[x, y]/\left(\prod f_i^{n_i}\right).$$There are various games we can play with these kinds of rings, including localization.
