I am trying to find a closed form for
$$ Y(n) = Y(n-1) -2Y(n-2) + 4^{n-2} \text{ with initial conditions } Y(0) = 2,Y(1) = 1 $$
using generating functions. However, I am still not entirely sure how the process works. Will I always want to choose some series $A(x) = \sum a_nx^n$ to substitute for $Y(n)$ and remove successive terms as necessary to get the $Y(n-1)$ and $Y(n-2)$ terms? Are there other choices for functions, or other tricks to be aware of?
Let $A(x):=\sum_{n\ge 0} Y_n\,x^n$. Then we have $$A(x)= 2+x+\sum_{n\ge 2} (Y_{n-1}-2Y_{n-2}+4^{n-2})x^n= \\ = 2+x+\sum_{n\ge 2} Y_{n-1}x\cdot x^{n-1}-2\sum_{n\ge 2}Y_{n-2}x^2\cdot x^{n-2}+\sum_{n\ge 2}4^{n-2}x^2\cdot x^{n-2} = \\ = 2+x+(x\cdot A(x)-2x)-2x^2\cdot A(x)+x^2\cdot\sum_{k\ge 0}(4x)^k = \\ = 2-x+(x-2x^2)\cdot A(x)+\frac{x^2}{1-4x} \,. $$ From this, $A(x)$ is expressible, then find its Taylor series.