From
$$ax - by = 0 \tag{1}\label{eq1}$$
you can get that
$$x = \frac{by}{a} \tag{2}\label{eq2}$$
$$y = \frac{ax}{b} \tag{3}\label{eq3}$$
First, since $x$ and $y$ are integers, \eqref{eq2} shows that
$$a \mid by \tag{4}\label{eq4}$$
Let
$$d = \gcd(a,b) \tag{5}\label{eq5}$$
$$a = de, \; e \in \mathbb{Z^{+}} \tag{6}\label{eq6}$$
$$b = df, \; f \in \mathbb{Z^{+}} \tag{7}\label{eq7}$$
Note \eqref{eq5}, \eqref{eq6} and \eqref{eq7} shows that
$$\gcd(e,f) = 1 \tag{8}\label{eq8}$$
Using \eqref{eq6} and \eqref{eq7} in \eqref{eq4} gives
$$de \mid dfy \implies e \mid fy \tag{9}\label{eq9}$$
Note \eqref{eq8} means $e \mid y$. Thus, the smallest positive integer $y$ is $y = e$. Using this and \eqref{eq6} in \eqref{eq2} gives
$$x = \frac{be}{de} = \frac{b}{d} = \frac{b}{\gcd(a,b)} \tag{10}\label{eq10}$$
Using a similar procedure, plus from substituting \eqref{eq10} in \eqref{eq3}, you can get that
$$y = \frac{a}{\gcd(a,b)} \tag{11}\label{eq11}$$