The question is based on the example given in Intersection Theory under the heading Self-intersection. The example is as follows:
Consider a line $L$ in the projective plane $\mathbb{CP}^{2}$: it has self-intersection number $1$ since all other lines cross it once: one can push $L$ off to $L′$, and $L · L′ = 1$ (for any choice) of $L′$, hence $L · L = 1$.
Given that my current knowledge on algebraic geometry is limited I was wondering if one can calculate this number by algebraically (if it is possible) computing the intersection point of $L$ and $L'$?
Yes. If two algebraic curves $C$ and $D$ lie on a surface $X$, $p \in C\cap D$ and $\{c=0\}$ and $\{d=0\}$ are local equations of $C$ and $D$, respectively, on a neighborhood of $p$, then the intersection number at p is $$ {\rm dim}_{\mathbb{C}}\frac{\mathcal{O}_{X,p}}{<c_p, d_p>} $$ where $c_p$ and $d_p$ are the localizations of $c$ and $d$ at $p$. The sum of these for all $p$ gives $C\cdot D$.
Take a look at the first chapter of Beauville's Complex Algebraic Surfaces.