The standard methods for solving difference equations are very similar to the methods for solving differential equations. Both equations here are "linear non-homogeneous equations with constant coefficients". We can solve them by first solving the "associated homogeneous equation" for the general solution, then add one solution to the entire equation.
The "associated homogenous equation" for the second equation is \(\displaystyle y[n+ 2]+ 3y[n+1]- 4y[n]= 0\). We know from experience that exponential satisfy such equations so we try a solution of the form \(\displaystyle y[n]= a^n\) for some n. Then \(\displaystyle y[n+1]= a^{n+1}= (a)(a^n)\) and \(\displaystyle y[n+2]= a^{n+2}= (a^2)(a^n)\). Putting those into the equation, \(\displaystyle y[n+2]+ 3y[n+1]- 4y[n]= (a^2)(a^n)+ 3(a)(a^n)- 4a^n= 0\). Dividing through by \(\displaystyle a^n\), we get the "characteristic equation" \(\displaystyle a^2+ 3a- 4= (a+ 4)(a- 1)= 0\) so \(\displaystyle a= 1\) or \(\displaystyle a= -4\). That is, \(\displaystyle C(1)^n+ D(-4)^n= C+ D(-4)^n\) is the general solution to the homogeneous equation. Now we look for a single function that will satisfy the entire equation. Since the right side, n- 1, is linear, we cross our fingers and try a linear solution. That, try y[n]= An+ B for constants, A and B.
However, I just did that and was unable to get a solution! I should have realized that wouldn't work because a= 1 was a root of the characteristic equation so that \(\displaystyle 1^n\) and polynomial multiples of that can be solutions to the associated homogeneous equation. Instead try \(\displaystyle y[n]= An^2+ Bn\)! Then \(\displaystyle y[n+2]= A(n+ 2)^2+ B(n+2)= An^2+ (4A+ B)n+ (4A+ 2B)\) and \(\displaystyle y[n+ 1]= A(n+1)^2+ B(n+1)= An^2+ 2An+ A+ Bn+ B= An^2+ (2A+ B)n+ (A+ B)\). So the equation becomes \(\displaystyle y[n+2]+ 3y[n+1]- 4y[n]= An^2+ (4A+ B)n+ (4A+ 2B)+ 3An^2+ (6A+ 3B)n+ (3A+ 3B)- 4An^2- 4Bn= (A+ 3A- 4A)n^2+ (4A+ B+ 6A+ 3B- 4B)n+ (4A+ 2B+ 3A+ 3B)= (10A)n+ (7A+ 6B)= n- 1\). (The fact that the \(\displaystyle n^2\) terms cancel is the result of 1 being a root of the characteristic equation.)
So we must have \(\displaystyle 10a= 1\) and \(\displaystyle 7A- 6B= -1\). Obviously, we must have \(\displaystyle a= \frac{1}{10}\) and then \(\displaystyle \frac{7}{10}- 6B= 1\) so \(\displaystyle 6B= 1- \frac{7}{10}= \frac{3}{10}\) and \(\displaystyle B= \frac{1}{20}\). That is, \(\displaystyle y[n]= \frac{1}{10}n^2+ \frac{1}{20}n\) satisfies the entire equation.
All of that tells us that the general solution to the equation \(\displaystyle y[n+2]+ 3y[n+1]- 4y[n]= n- 1\) is \(\displaystyle y[n]= C(-1)^n+ D(4^n)+ \frac{1}{10}n^2+ \frac{1}{20}n\).