\begin{center}\begin{tikzpicture}
\matrix (m)
[
matrix of math nodes,
row sep = 3em,
column sep = 4em
]
{
1 & 3 \\
2 & 4\\
};
\end{tikzpicture}\end{center}
I'd like to draw a vertical line to separate the two sides of the matrix. I realize one can extend the matrix and such but I'd rather have something that is a bit more general and doesn't explicitly depend on a bunch of stuff(such as specifying nodes, extending the matrix size, computing mid points using some package, etc). (this way it works for more complex examples).

\draw (m.north) -- (m.south);. If not, have a look at myfixed matrixin this answer. – Max Sep 10 '18 at 12:49