Let $D$ be a principal ideal domain and $a$ and $b$ be nonzero elements of $D$. Prove that there exist elements $s$ and $t$ in $D$ such that $\gcd(a, b) = as + bt$.
I would like to use some properties of $\text{PID}$s to prove this but I am only thinking of well-ordering principle that is used to prove for integers, which I don't think I can use since $D$ is not necessarily the set of integers, right? Any ideas?