Let $K = \mathbb{Q}[i]$ and $\mathcal{O}_K = \mathbb{Z}[i]$. Suppose $a = 1 + 2i$ and $q = 7$. Since $a$ and $q$ are coprime algebraic integer, then there must exists $b \in \mathcal{O}_K $ s.t. $a * b = 1 \pmod{q} $.
Is there an algorithm for finding that for a general number field $K$?
If I understood correctly, you need
$$(1+2i)(a+bi)=1+7m\;,\;\;a,b,m\in\Bbb Z\implies a-2b+(2a+b)i=1+7m\iff$$
$$\begin{cases}a-2b=1+7m\\{}\\2a+b=0\end{cases}\;\;\;\implies5a=1+7m\implies a=3\pmod 7\;,\;\;b=-2a=1\pmod7$$
Thus, for example, with $\;3+i\;$:
$$(3+i)(1+2i)=1+7i=1\pmod7$$
But you could pick as well $\;10+8i\;$ say , since
$$(10+8i)(1+2i)=-6+28i=1\pmod7$$