Recall that every ideal of $\mathbb{Q}[x]$ is a principal ideal. Find a generator of the ideal $I = ⟨x^4 + x^3 − 3x^2 − 5x − 2, x^3 + 3x^2 − 6x − 8⟩ ⊆ \mathbb{Q}[x]$.
My general idea was that in order for something to be a generator of $I$ it must be able to generate both $x^4 + x^3 − 3x^2 − 5x − 2$ and $x^3 + 3x^2 − 6x − 8$ If you were able to find a common factor between the two of them, the multiplication of those factors would produce the generator of the ideal. I'm not sure if I am on the right track.
To summarise the comments, by using the Euclidean algorithm we compute that $$ d=gcd(f,g)=x^2-x-2=(x-2)(x+1). $$ So the ideal $I$ is generated by $d$. Note that your $x-1$ is not a linear factor.