Actually there is no need to guess the solution at all, even to prove the general linear ODE solution.
$
\def\cc{\mathbb{C}}
$
All we have to do is to abstract out the operators from the differential equation, and everything falls into place. Namely let $D$ be the differential operator:
$D(f) = f'$ for every differentiable function $f : \cc \to \cc$.
Then the equation is simply:
$(aD^2+bD+c)(y) = 0$.
where addition and scalar multiplication of operators are pointwise, and "$0$" is the zero function. If it is not clear what is going on here, just keep this apparently fanciful reasoning in mind first and compare it with the concrete translation in the last section.
This naturally yells at us to factorize the quadratic operator, which we can do so using the roots $p,q$ of the associated quadratic equation:
$(D-p)(D-q)(y) = 0$.
This ability to factorize crucially depends on the fact that $D$ is a linear operator. Now observe that we already know the solution to the following equation (which is essentially the base case):
$(D-p)(z) = 0$.
Namely:
$z = ( \cc\ x \mapsto A\exp(px) )$ for some constant $A \in \cc$.
[Namely $z$ is a function with domain $\cc$ such that $z(x) = A\exp(px)$ for every $x \in \cc$.]
Thus we get:
$(D-q)(y) = ( \cc\ x \mapsto A\exp(px) )$ for some constant $A \in \cc$. [1]
All that remains is to make the right-hand expression zero and we can use induction to finish. This is exactly where it matters whether $q = p$ or not.
If $q \ne p$ then:
$(D-q)(\exp(px)) = ( \cc\ x \mapsto (p-q)\cdot\exp(px) )$. [2a]
If $q = p$ then:
$(D-q)(x\cdot\exp(px)) = ( \cc\ x \mapsto \exp(px) )$. [2b]
Therefore we can subtract from [1] a suitable multiple of either [2a] or [2b] as appropriate, to make the right-hand expression zero, and hence can continue as desired. This technique easily generalizes to the general linear ODE solution, and shows that the degree of the polynomial multiplied to each factor $\exp(rx)$ depends exactly on the multiplicity of the root $r$ of the characteristic polynomial. I shall leave the details to the aspiring reader!
Curiously, for the quadratic case there is a sneaky quick trick if $p \ne q$:
$(D-q)(y) = ( \cc\ x \mapsto A\exp(px) )$ for some constant $A \in \cc$.
$(D-p)(y) = ( \cc\ x \mapsto B\exp(qx) )$ for some constant $B \in \cc$.
Subtracting immediately gives:
$(p-q)(y) = ( \cc\ x \mapsto A\exp(px) + B\exp(qx) )$.
And we are done!!
Here is a bit more explanation of the notation used to combine operators. Just as we can perform pointwise operations on functions, we can do the same for operators. So given any differentiable function $f : \cc \to \cc$, we have the function $aD^2(f) : \cc \to \cc$ where $(aD^2(f))(x) = af''(x)$ for every $x \in \cc$, and we have the function $(bD+c)(f) : \cc \to \cc$ where $((bD+c)(f))(x) = bf'(x)+cf(x)$ for every $x \in \cc$.
If you wish to see how it works concretely, just translate everything to the usual form. For example, here is what the sneaky trick for $p \ne q$ looks like in full:
Let $p,q$ be the roots in $\cc$ of the quadratic $( X \mapsto aX^2+bX+c )$.
Let $z(x) = y'(x)-q\ y(x)$ for every $x \in \cc$.
Then $z'(x) = y''(x)-q\ y'(x)$ for every $x \in \cc$.
Thus $z'(x)-p\ z(x) = y''(x)-(p+q)\ y'(x)+pq\ y(x) = 0$ for every $x \in \cc$.
Thus $y'(x)-q\ y(x) = z(x) = A\exp(px)$ for every $x \in \cc$, for some constant $A \in \cc$.
Similarly $y'(x)-p\ y(x) = B\exp(qx)$ for every $x \in \cc$, for some constant $A \in \cc$.
Thus $(p-q)\ y(x) = A\exp(px) + B\exp(qx)$ for every $x \in \cc$.
Tada! Done without operators, but the elegance is gone.