Let $X,Y$ be two distinct irreducible algebraic curves on a smooth complex projective surface $S$, prove it intersects at only a finite number of points and local defining equations are coprime on those intersection points.
My attempt: since $X,Y$ are distinct, we have $X\cap Y\subset X$ properly contained in $X$, as 0-dimensional topological space in a compact space, it should be a finite set.
So the question is reduced to prove that $X\cap Y$ is a zero-dimensional topological space, I don't have good idea to prove this fact. Does I follow the correct track?
Inspired by red_trumpet's hint, I found a solution in the analytic world.
Easy to see that $X\cap Y \subset X$ is a proper closed subset (proper since they are distinct), and it's an analytic subvariety. Pick a point $x\in X\cap Y$ that needs to show it's isolated.
Proof. Since exist a neiborhood around $x$ that $X\cap Y$ locally inside this neiborhood defined by some holomorphic function (with one variable), if exist limiting point, by the identity pricipal that if holomorphic function is one variable that has limiting zeros then it will vanish identically, then it will implies that $X\cap Y$ will contains an open subset of $X$. Which will implies that $X\cap Y = X$ by the lemma below, Contradiction.
Since this set $X\cap Y$ is discrete, in a compact space, it's finite.
Lemma Let $X$ being connected (irreducible implies connected), if the analytic subvariety $X\cap Y$ contains an open set of $X$, then $X\cap Y = X$
Proof. Use open-closed argument, want to show that $X\cap Y$ is also a open set. Taking interior $(X\cap Y)^o\subset X$ it's nonempty(by assumption), any limiting point $x$ of $(X\cap Y)^o$ lies in $X\cap Y$ since $X\cap Y$ closed, therefore exist a defining equation around $x$ that defining equation vanish on nonempty open subset, therefore it's identical zeros, therefore $x\in (X\cap Y)^o$.
The idea of my proof basically coming from E.M.Chirka's complex analytic sets.