$\!\!\bmod\,\overbrace{ x^2+1}^{\color{#c00}{\textstyle \!\!x^2\!\equiv\! -1}\!\!\!}\!:\,\ {-}20 \equiv (\overbrace{3-x\color{#c00}{x^2}}^{\!\!\!\!\!\textstyle 3+x})\,k$ $\iff k \equiv\dfrac{-20^{\phantom{|^|}}}{x+3} \equiv -20\left[ \dfrac{x\, -\, 3}{\smash{\underbrace{\color{#c00}{x^2}-9}_{\large\!\!\! -10}}}\right] \equiv 2(x-3)$
Remark $ $ If mod arithmetic is unfamiliar we can do the same by evaluating the hypothesized Bezout equation $\, 20 = k(x) (x^2-3) + h(x) (x^2+1)\,$ at $\,x = i^{\phantom{|^|}}\!\!,\,$ yielding
$$20 = k(i)(-i-3)\iff k(i) = \dfrac{\!\!-20}{i+3} = 2(i-3)\ \ \rm as\ above\quad $$
By theory we know there is a solution with $\,\deg k < \deg(x^2+2),\,$ so $\,k = ax+b,\,$ so $\, 2i-6 = k(i) = ai+b \iff (2-a)i = b+6\iff a=2,\, b=-6,\,$ by $\,i\not\in \Bbb Q$