We will use
$\mathbb N = \{1, 2, 3, 4, \ldots\}$ (the set of natural numbers) and
$\mathbb W = \{0, 1, 2, 3, \ldots\}$ (the set of whole numbers).
First we will define divides and gcd over $\mathbb N$. Then we will look at some of the consequences of those definitions, and finally we will look for a mathematically sound way to extend the definitions of divides and gcd to $\mathbb W.$
DIVIDES and GCD over $\mathbb N$
DEFINITION $1.1.$ For all $x, y \in \mathbb N,$ we say that $x$ divides $y$, writen $x|y$, if $\dfrac yx$ is in $\mathbb N.$
LEMMA $1.2.$ For all $x, y \in \mathbb N,$ $x|y$ if and only if there exists an $n \in \mathbb N$ such that
$y = nx.$
COROLLARY $1.2.A.$ For all $x, y \in \mathbb N,$ if $x|y$ then $x \le y.$
So, for example
$3|15$ because
$\dfrac{15}{3}$ is a natural number and because
$15=3 \cdot 5.$
DEFINITION $1.3.$ For any $n \in \mathbb N,$ we define the divisors of $n$
to be the set
$D_n=\{x \in \mathbb N: x|n\}$
THEOREM $1.4.$ For each $x,y \in \mathbb N,$ there exists a unique $g \in \mathbb N$ such that $D_x \cap D_y = D_g.$
Proof. Consider the prime decompositions
$x=\prod_{i=1}^{\infty}p_i^{\alpha_i}$ and
$y=\prod_{i=1}^{\infty}p_i^{\beta_i}$
where there exists some $N \ge 1$ such that
$\alpha_i = \beta_i = 0$ for all $i \ge N.$ It isn't hard to verify that
$g = \prod_{i=1}^{\infty} p_i^{\gamma_i}$ where
$\gamma_i = \min(\alpha_i, \beta_i)$ for all $i\ge 1$.
DEFINITION $1.5.$ For each $x,y \in \mathbb N, \gcd(x,y)$ is the unique $g \in \mathbb N$ such that $D_x \cap D_y = D_g.$
COROLLARY $1.5.A.$ For each $x,y \in \mathbb N, \gcd(x,y) = g$ if and only if
\begin{array}{ll}
(1.) & g|x \text{ and } g|y\\
(2.) & \text{If } z|x \text{ and } z|y \text{, then } z \le g
\end{array}
COROLLARY $1.5.B.$ For each $x,y \in \mathbb N, \gcd(x,y) = g$ if and only if
\begin{array}{ll}
(1.) & g|x \text{ and } g|y\\
(2.) & \text{If } z|x \text{ and } z|y \text{, then } z|g
\end{array}
How much trouble does trying to handle $0$ cause?
DEFINITION $1.1$ Almost still works with $0$ thrown in. We can claim, for example, that $4|0$ since $\dfrac 04 = 0.$ But, since $\dfrac 00$ is undefined, we can't decide if $0|0$ is True or False.
LEMMA $1.2$ Is the key to the problem. If we convert this lemma into a definition, then we haven't changed how "divides" works for the natural
numbers and now, we can demonstrate that $0|0.$
COROLLARY $1.2.A$ is now False since $4|0$ yet $4 \nleq 0.$ But, "divides" is a partial order and, with respect to that order, $4|0$ indicates that 0 is greater than 4.
DEFINITION $1.3$ Would be fine, except it might seem odd that $D_0 = \mathbb W.$
THEOREM $1.4$ is still true.
DEFINITION $1.5$ Will still make sense.
COROLLARY $1.5.A$ would no longer be true.
COROLLARY $1.5.B$ would still work if we claimed that $0|0$
DIVIDES and GCD over $\mathbb W$
So, how are we to handle $0?$ What follows is essentially the modern approach. In this approach, $0|0$ and $\gcd(0,0) = 0.$
DEFINITION $1.1.$ For all $x, y \in \mathbb W,$ $x|y$ if and only if there exists an $n \in \mathbb W$ such that
$y = nx.$
So $0|0$ because $0 = 0 \cdot 0.$
DEFINITION $1.3.$ For any $n \in \mathbb W,$ we define the divisors of $n$
to be the set
$D_n=\{x \in \mathbb W: x|n\}$
In particular, $D_0 = \mathbb W.$
THEOREM $1.4.$ For each $x,y \in \mathbb W,$ there exists a unique $g \in \mathbb W$ such that $D_x \cap D_y = D_g.$
In particular, $D_0 \cap D_0 = D_0.$
Proof. Use the old proof for $x, y \gt 0.$ The special cases are easy to handle.
DEFINITION $1.5.$ For each $x,y \in \mathbb W, \gcd(x,y)$ is the unique $g \in \mathbb N$ such that $D_x \cap D_y = D_g.$
It follows that $\gcd(0,0) = 0.$
COROLLARY $1.5.B.$ For each $x,y \in \mathbb W, \gcd(x,y) = g$ if and only if
\begin{array}{ll}
(1.) & g|x \text{ and } g|y\\
(2.) & \text{If } z|x \text{ and } z|y \text{, then } z|g
\end{array}
Note that one way to read condition (2) is that it indicates that $g$ is the "greatest" divisor or $x$ and $y$ with respect to the partial order $divides$.