For example ,the diophantine equation $$x^2+1=25y$$ we can solve this by finding particular solution $(x,y)=(7,2)$ and using this , we can get general solution.
My question is "To solve $ax^2+by+c=0$ $(a, b, c \in \mathbb{Z})$ we must find particular solution or not?"
Assume $b>0$. If $b<0$ make a change of variables $y'=-y$. Let $d=\gcd(a,b)$, then $d$ must divide $c$ so we can reduce $\{a,b,c\}$ to $\{a/d,b/d,c/d\}$. Hence we assume that $\gcd(a,b)=1$.
Next, suppose $d = \gcd(b,c)$. Then since $\gcd(a,b)=1$, $d$ must divide $x^2$. Let $d=u^2v$ so that $v$ is squarefree, then $x$ must be of the form $x=uvw$ for some integer $w$, so we can replace the equation with $$ \begin{align} ax^2 + by + c &= 0\\ a\frac{u^2v^2w^2}{d} + \frac{b}{d} y + \frac{c}{d} &= 0\\ (av) w^2 + (b/d) y + (c/d) &= 0 \end{align} $$ So we replace $\{a,b,c\}$ by $\{av,b/d,c/d\}$.
After these two replacements, $\gcd(b,c)=1$. If $d=\gcd(a,b)\neq 1$, then $d$ must divide $c$. This contradicts $\gcd(b,c)=1$, so there are no solutions and we are done.
Hence for the remaining case we may assume that $\gcd(a,b)=\gcd(b,c)=1$. Now the problem can be reduced to solving $$ ax^2 + c \equiv 0 \pmod b \implies x^2 \equiv -ca^{-1} \pmod b $$ i.e. a solutions exist iff $-ca^{-1}$ is a quadratic residue $\pmod b$.
If $x$ is a solution so is $x+kb$ for any $k\in\mathbb Z$, so the distinct infinite classes can be classified by distinct solutions $0\leq x < b$ (which can be none). This is a finite search which in some sense solves the problem.
For the given example it would be $x=7,18$ for the base case $0\leq x < 25$, so the two infinite classes are $x=7+25k$ and $x=18+25k$ for $k\in\mathbb Z$.
To expand on this more, let the unique prime factorization of $b$ be $$ b = \prod_{i=1}^kp_i^{e_i} $$
Then the equation can be split into $$ \begin{align} x^2 &\equiv -ca^{-1} \pmod{p_i^{e_i}},\quad 1\leq i \leq k \end{align} $$ By solving each equation, the base solutions can be combined/obtained via Chinese Remainder Theorem. Also note that $a,c\not \equiv 0 \pmod{p_i}$ since $\gcd(a,b)=\gcd(b,c)=1$ by construction, so $x\not\equiv 0 \pmod{p_i}$.
Edit 1: The discussion below works for odd primes but gets tricky for even prime powers. If $2^t$ divides $b$ then the equation $$ x^2 \equiv -ca^{-1} \pmod{2^t} $$ needs to be considered separately.
For each odd prime, as $-ca^{-1} \not\equiv 0 \pmod {p_i}$, then a solution to $$ x^2 \equiv -ca^{-1} \pmod {p_i} $$ depends on whether $-ca^{-1}$ is a quadratic residue $\pmod{p_i}$. This will give either zero or two solutions $\pmod{p_i}$. If any one of the equations has no solutions, then there must be zero solutions for the original equation.
Otherwise, each equation $\pmod{p_i}$ has two solutions. Then since $x\not\equiv 0 \pmod{p_i}$, by Hensel's lifting it can be shown that there are also exactly two solutions $\pmod{p_i^{e_i}}$.
Since each of the $k$ equation has two solutions, after CRT there will be $2^k$ base solutions. This in turn gives $2^k$ infinite classes.
Edit 1: If one of the primes is even then the combination of the odd primes gives $2^{k-1}$ classes. The total number depends on how many classes there are for $x^2\equiv 0\pmod{p_1^{e_1} = 2^{e_1}}$.