To correctly pattern-match $\,\color{#c00}x\,$ in the above $\,\rm\color{#0a0}{scaled}\,$ Bezout equations do as follows.
$\qquad\ \begin{align}
\ -7\cdot \color{#90f}{15}&\ +\ 4\cdot 7\cdot 4\,\ =\ \color{#0a0} 7\ \ [=\ \color{#0a0}{7\ {\rm times}} {\rm \ Bezout\ of\ } \gcd(15,4)=1\,]\\[.2em]
\Rightarrow\ \bmod \color{#90f}{15}&\!:\,\ \ \ \ 4\cdot\color{#c00}{ 7\cdot 4} \ \equiv\ \ 7\\
\rm so &\,\ \ \ \ \ \ \ 4\ \cdot\ \color{#c00} x\ \ \, \equiv\, \ \ 7\ \ \ {\rm for}\ \ \ \color{#c00}{x\equiv 7\cdot 4}\equiv 13 \\[.6em]
\ 5\cdot \color{#90f}{16}&\, + 3\cdot 5(-5)\, =\, \color{#0a0}5\ \ [=\ \color{#0a0}{5\ {\rm times}} {\rm \ Bezout\ of\ } \gcd(16,3)=1\,]\\[.2em]
\Rightarrow\ \bmod \color{#90f}{16}&\!:\,\ \ 3\cdot\color{#c00}{ 5(-5)}\, \equiv\ 5\\
\rm so &\,\ \ \ \ \ 3\ \cdot\ \color{#c00} x\ \ \ \,\equiv\ \ \ \ 5\ \ \ {\rm for}\ \ \ \color{#c00}{x\equiv 5(-5)}\equiv 7
\end{align}$
Simpler $\bmod 15\!:\,\ 4x\equiv7\iff x \equiv \dfrac{7}{4}\equiv \dfrac{-8}4\equiv -2\equiv 13$
Similarly $\bmod 16\!:\,\ 3x\equiv 5\iff x\equiv \dfrac{5}3\equiv\dfrac{21}3\equiv 7\ $ where we subtracted or added the modulus to the numerator to make the division exact, a special case of Inverse Reciprocity.
Beware $\ $ Modular fraction arithmetic is well-defined only for fractions with denominator coprime to the modulus. See here for further discussion.