Look up Hensel's lemma. E.g., in the following form ($K$ is a field, without further assumptions):
Let $f \in K[[X]][Y]$ be monic and such that $f(0,Y)=p(Y)q(Y)$, where $p(Y),q(Y) \in K[Y]$ are relatively prime and non-constant, of degrees respectively $r$ and $s$. Then there exist two uniquely determined polynomials $g,h \in K[[X]][Y]$, of degrees respectively $r$ and $s$, such that $f=gh$, with $g(0,Y)=p(Y)$ and $h(0,Y)=q(Y)$.
(after Hefez, Abramo: Irreducible plane curve singularities. Real and complex singularities, 1–120, Lecture Notes in Pure and Appl. Math., 232, Dekker, New York, 2003)
More information, including the $p$-adic version, can be found here:
(especially Wanderer's answer).