I am trying to draw the explicit formula of $S_n$ that is defined as below:
$S_n$ is the number of words of length n using 0,1 and 2 such that no two consecutive 0's occur.
Myself, as I had learned from the basic skills in combinatorics, just easily get to the point constructing recursive relation such that:
$$S_n = 2S_{n-1} + 2S_{n-2}$$
since $S_n$ splits up to disjoint two cases: one with no 0 at the last posit, and always 0 at the last locus, then there exist bijection between the former one and 1 or 2 at the n-th posit multiplied with $S_{n-1} $ cases, and also another bijection between the latter one and 1 or 2 at the n-1-th posit multiplied with $S_{n-2}$.
So If my given recursion is correct, next step is how could I go further into the formulating with what.
I superficially knows the concept of $OGF$, and $EGF$, and their formal definition. Generating function contains its sequential information in a form of coefficients with a corresponding polynomial degrees as an index (as far as I understand).
Now if I define $S_n$ a functional form, $s(n)$, generating function would be :
$$g(x) = \sum_{n=0}^{\infty}s(n)x^n$$
Then let's little bit refer to a few terms of $S_n$:
$$1, 3, 8, 22, ...$$
And revise the $g(x)$:
$$g(x) = \sum_{n=0}^{\infty}s(n)x^n =\sum_{n=2}^{\infty}s(n)x^n+3x+1=2\sum_{n=2}^{\infty}s(n-1)x^n+2\sum_{n=2}^{\infty}s(n-2)x^n+3x+1 $$
Now, it looks like the problem has been changed into solve the functional equation(I am not sure this is right term)
1) What should be the next step?
2) Is the generating function the only approach toward the explicit formula?
Let's assume, for the sake of argument, that your recurrence relation is correct. Notice it is of a very specific form: linear, homogeneous, constant-coefficient. So we can treat it in a manner analogous to the methods for linear constant-coefficient homogeneous ODE's.
Starting with $S_0 = a$, $S_1 = b$, $S_n = 2S_{n-1}+2S_{n-2}$, we assume our solution is of the form $r^n$, and we have: $$r^n = 2r^{n-1} + 2r^{n-2}$$ or $$r^2-2r-2 = (r-1)^2-3 = 0$$ This indicates that we have the following roots of the characteristic equation: $r = 1+\sqrt{3}$, $r = 1-\sqrt{3}$, and our solution is hence of the form:
$$S_n = c_1(1+\sqrt{3})^n + c_2(1-\sqrt{3})^n$$ Setting $n=0$, $S_0 = a$, and $n=1$, $S_1 = b$, we have: $$S_0 = c_1 + c_2 = a$$ $$S_1 = c_1(1+\sqrt{3}) + c_2(1-\sqrt{3}) = (c_1+c_2) + (c_1-c_2)\sqrt{3} = a+(c_1-c_2)\sqrt{3} = b$$ (Notice we use the first relation to simplify the second slightly)
We immediately conclude that: $$c_1+c_2 = a$$ $$c_1-c_2 = \frac{b-a}{\sqrt{3}}$$ And our coefficients are hence: $$c_1 = \frac{1}{2}\left(a+\frac{b-a}{\sqrt{3}}\right),\quad\quad c_2 = \frac{1}{2}\left(a-\frac{b-a}{\sqrt{3}}\right)$$ and our solution is then: $$S_n = \frac{1}{2}\left(a+\frac{b-a}{\sqrt{3}}\right)(1+\sqrt{3})^n + \frac{1}{2}\left(a-\frac{b-a}{\sqrt{3}}\right)(1-\sqrt{3})^n$$
As in your above example, assume $S_0 = 1 = a$, $S_1 = 3 = b$. The sequence we generate is then: $$\{1,3,8,22,60,164,448,1224,3344,9136,...\}$$ (This also allows you to do things like compute the 197th term, which is 104868469426569085732577150729898576235889082115592545033891653100711477046912718209024)
Unfortunately, if the recurrence is not of this special form, things become more complicated, but there are a number of good references on discrete mathematics which can build on these methods. (For instance, Concrete Mathematics by Knuth, Discrete Mathematics And Its Applications by Rosen, Discrete Mathematics by Gallier, Discrete Mathematics for Computer Scientists by Stein et al, ...)
(Your recurrence relation does appear to be correct, but I didn't check this since it didn't seem the main focus. Rather, I am only showing an alternative to generating functions in solving recurrence relations of this form, as well as giving some references in case you run across more general/complicated recurrences.)