Euler's Four Number Theorem ($\rm 4NT$) shows how to derive a common refinement of two factorizations $\,ab = cd,\,$ see $(3)$ below. It is a fundamental result in divisor theory, very closely related to uniqueness of prime factorizations, so we give a few proofs below to help lend insight.
$(1)\ $ By here $\,a\mid cd\Rightarrow \color{#c00}{a = xy},\ x\mid c,\ y\mid d,\,$ so $\, c = xz,\ \color{#0a0}{d = yw},\,$ for some $\,z,w\in\Bbb Z,\,$ hence using these values to solve for $\,b\,$ we obtain $\,b = c/\color{#0a0}d\color{#c00}a = xz\color{#0a0}{yw}/(\color{#c00}{xy}) = zw$.
$(2)\ $ equal fractions are scalings of a reduced fraction $\,\large \color{#c00}{\frac{x}w},\,$ by unique fractionization, so
$$\dfrac{a}d = \dfrac{c}b\ \Rightarrow\
\begin{align} &a = y\,\color{#c00} x,\ \ c = z\, \color{#c00}x\\
&d = y\:\! \color{#c00} w,\ \ b = z\:\! \color{#c00}w \end{align}\qquad$$
$(3)\ \,{\rm let}\, \ \color{#90f}{g :=(a,b,c,d)}.\,$ Cancelling $\,g^2\,$ from $\,\color{#0a0}{ab}=\color{#c00}{cd}\,$ reduces to case $\,\color{#90f}{g = 1}\,$ with solution
$$ \overbrace{\underbrace{(a,c)}_{\textstyle x}\underbrace{(a,d)}_{\textstyle
y}}^{\textstyle \color{#0a0}a}\,\overbrace{\underbrace{(b,c)}_{\textstyle z}\underbrace{(b,d)}_{\textstyle w}}^{\textstyle\color{#0a0} b}\, =\, \overbrace{\underbrace{(c,a)}_{\textstyle x}\underbrace{(c,b)}_{\textstyle
z}}^{\textstyle\color{#c00}c} \overbrace{\underbrace{(d,a)}_{\textstyle y}\underbrace{(d,b)}_{\textstyle w}}^{\textstyle\color{#c00}d}\qquad$$
by $\ (a,c)(a,d) = (a(a,c,d),\color{#c00}{cd}) = (a(a,c,d),\color{#c00}{ab}) = a(\color{#90f}{a,c,d,b}) = a,\,$ and similarly for the other products (by symmetry). Here $\,(a,c)(a,d)(b,c)(b,d)\,$ is a common refinement of the two factorizations $\,ab = n = cd.\,$ See here for more details on such gcd arithmetic (& ideal arithmetic).
Remark $ $ The solution is summarized by the following Shreier refinement matrix formulation of Euler's Four Number Theorem for the proofs $(2)$ and $(3)$ above
$$\begin{array}{c | c c}
(2) & c & d\\
\hline
\color{#c00}a& \color{#c00}x & \color{#c00}y\\
b& z & w
\end{array}\qquad
\begin{array}{c | c c}
(3)&\ c & d\\
\hline
\color{#c00}a&\color{#c00}{(a,c)} & \color{#c00}{(a,d)}\\
b& (b,c) & (b,d)
\end{array}\qquad$$
where the row label is the product of the row elements, $ $ e.g. $\, \color{#c00}{xy = a = (a,c)(a,d)},\,$ and likewise the column label is the product of the column elements, e.g. $\, xz = c = (a,c)(b,c).\,$ Analogous refinement matrices can display the common refinements of two (any length) factorizations of the same element in a UFD or gcd domain, e.g. see this answer, which also explains how this is equivalent to uniqueness of prime factorizations (and many well-known equivalent properties).