About the general matter of deriving the existence of solutions over $\Bbb Q$ from solutions modulo every prime it is worth recalling the classical theorem in Number Theory that goes under the name of Hasse's Principle that a quadratic form
$$
F(X_1,..X_n)=\sum_{1\geq i\geq j\geq n}a_{ij}X_iX_j\in\Bbb Q[X_1,...,X_n]
$$
represents $0$ (i.e. admits a non-trivial solution of $F(X_1,..X_n)=0$ in $\Bbb Q^n$) if and only if it represents $0$ over $\Bbb R$ and all the $p$-adic fields $\Bbb Q_p$.
In turn, to go from a solution mod $p$ to a solution in $\Bbb Q_p$ one has to apply Hensel's Lemma.
Mind, though, that the proofs are not constructive. E.g., see Serre's book A Course in Arithmetic, Springer GTM 7.
These general results do apply to Pell's equation, because one can homogenize it, i.e. solving $X^2-mY^2=1$ is equivalent to find a representation of $0$ of
$$
X^2-mY^2-Z^2.
$$
Nonetheless, they are not too conclusive, in the sense that they do not allow to say that there exist solutions of Pell's equation different from the trivial ones, namely $X=\pm1$, $Y=0$.