Are you looking for \sim ("row equivalence sign")? (Also: *matrix doesn't take an optional parameter.)
Code
\documentclass{article}
\begin{document}
\[
\left(\begin{array}{@{}ccc|c@{}}
1 & 2 & 0 & 0 \\
-1 & 1 & 2 & 0 \\
1 & 0 & 1 & 5 \\
0 & -2 & 1 & 4
\end{array}\right)
\sim
\left(\begin{array}{@{}ccc|c@{}}
1 & 2 & 0 & 0 \\
0 & 3 & 2 & 0 \\
0 & -2 & 1 & 5 \\
0 & -2 & 1 & 4
\end{array}\right)
\]
\end{document}
Output

Improvement
If you use those matrices more than once you can define a new environment that does this for you:
\documentclass{article}
\newenvironment{rowequmat}[1]{\left(\array{@{}#1@{}}}{\endarray\right)}
\begin{document}
\[
\begin{rowequmat}{ccc|c}
1 & 2 & 0 & 0 \\
-1 & 1 & 2 & 0 \\
1 & 0 & 1 & 5 \\
0 & -2 & 1 & 4
\end{rowequmat}
\sim
\begin{rowequmat}{ccc|c}
1 & 2 & 0 & 0 \\
0 & 3 & 2 & 0 \\
0 & -2 & 1 & 5 \\
0 & -2 & 1 & 4
\end{rowequmat}
\]
\end{document}
\left(and\right)use\left[and\right](or\lbrackand\rbrackinstead of[and]). – Qrrbrbirlbel Jan 22 '23 at 22:28