Consider
$$(x + 1 + 1/x)^4=\frac{(x^2+x+1)^4}{x^4}$$ then we want to find the coefficient of $x^4$ in the expansion $(x^2+x+1)^4$. Note you don't need to do this and can just apply the below method to $(x + 1 + 1/x)^4$.
Using the multinomial theorem (in this case it is called the trinomial expansion) we have $$
(x_1+x_2+x_3)^n=\sum_{k_1+k_2+k_3=n}\binom{n}{k_1,k_2,k_3}x_1^{k_1}x_2^{k_2}x_3^{k_3}
$$
where $\dbinom{n}{k_1,k_2,k_3} = \dfrac{n!}{k_1! \, k_2! \, k_3!}$.
Setting $n=4,x_1=x^2,x_2=x$ and $x_3=1$, we want $x_1^{k_1}x_2^{k_2}=x^4,$ which is equivalent to $2k_1+k_2=4$, where $k_1+k_2\leq 4$ and $k_1+k_2+k_3=4$. There's only a few values to check.
Thus the coefficient is $\dbinom{4}{0,4,0}+\dbinom{4}{1,2,1}+\dbinom{4}{2,0,2}=19.$