\(x\left(x-2018\right)-2019x+2018\cdot2019=0\)
\(x\left(x-2018\right)-2019\left(x-2018\right)=0\)
\(\left(x-2018\right)\left(x-2019\right)=0\)
\(\Rightarrow\left[{}\begin{matrix}x-2018=0\\x-2019=0\end{matrix}\right.\Rightarrow\left[{}\begin{matrix}x=2018\\x=2019\end{matrix}\right.\)