We will solve the differential equation $$ay^{\prime \prime}+by^\prime+cy=f(t).$$ A solution to this differential equation is of the form $$y=y_h+y_p$$ where $y_h$ is a general solution to the homogeneous differential equations $$ay^{\prime \prime}+by^\prime+cy=0,$$ and $y_p$ is any particular solution to the non-homogeneous differential equation.
To solve the homogeneous differential equation, "guess" the solution $y_h=e^{rt}$. When you plug this in and simplify you'll obtain the characteristic equation: $$ar^2+br^2+cr=0.$$ This quadratic equation either has 2 real sollutions, 1 real solution, or 2 complex congujate solutions. In each case, the form of the solution to the differential equation is different:
See Trench section 5.1 for a more detailed discussion of why we build our general solution from two linearly independent solutions. Also this section includes a discussion of how to determine whether two solutions are, in fact, linearly indepedent.
To find a particular solution to $$ay^{\prime \prime}+by^\prime+cy=f(t)$$ we will "guess" a solution that looks like $f(t)$ and see if it works. We'll illustrate what looks like means with an example.
Let's guess $y_p=(Ax+B)e^{-x}$. Then \begin{align*} y_p&=(Ax+B)e^{-x}\\ y_p^\prime&=(A-B-Ax)e^{-x}\\ y_p^{\prime \prime}&=(B-2A+Ax)e^{-x}.\\ \end{align*}
Plug these in to the DE: \begin{align*} y^{\prime \prime}-4y^\prime-5y&=-6xe^{-x}\\ ((B-2A+Ax)e^{-x})-4((A-B-Ax)e^{-x})-5((Ax+B)e^{-x})&=-6xe^{-x}\\ e^{-x}(B-2A-4A+4B-5B)+xe^{-x}(A+4A-5A)&=-6xe^{-x}\\ -6Ae^{-x}&=-6xe^{-x}.\\ \end{align*}
But, $A$ was meant to be a constant. So, this first guess doesn't work. Let's try again with $y_p=(Ax^2+Bx+C)e^{-x}$. This time we have
\begin{align*} y_p&=(Ax^2+Bx+C)e^{-x}\\ y_p^\prime&=(B-C+(2A-B)x-Ax^2)e^{-x}\\ y_p^{\prime \prime}&=(2A-2B+C+(B-4A)x+Ax^2)e^{-x}.\\ \end{align*}Plug these into the DE: \begin{align*} y^{\prime \prime}-4y^\prime-5y&=-6xe^{-x}\\ ((2A-2B+C+(B-4A)x+Ax^2)e^{-x})-4((B-C+(2A-B)x-Ax^2)e^{-x})-5((Ax^2+Bx+C)e^{-x})&=-6xe^{-x}\\ ((2A-2B+C-4B+4C-5C)+(B-4A-8A+4B-5B)x+(A+4A-5A)x^2)e^{-x}&=-6xe^{-x}\\ ((2A-6B)+(-12A)x)e^{-x}&=-6xe^{-x}.\\ \end{align*}
So we need $-12A=-6$ and $2A-6B=0$. Solving we find $A=\frac{1}{2}$ and $B=\frac{1}{6}$. A particular solution to the DE is $$y_p=\left(\frac{1}{2}x^2+\frac{1}{6}x\right)e^{-x}.$$
The general solution to the DE is then \begin{align*} y&=y_h+y_p\\ &=c_1e^{-5x}+c_2e^{-x}+\left(\frac{1}{2}x^2+\frac{1}{6}x\right)e^{-x}.\\ \end{align*}
Finding the homogeneous solution was not illustrated here. If you like, there are criteria for "guessing" a particular solution at the end of section 5.4 in Trench. Section 5.5 discusses the case where the forcing function includes trigonometric functions.