Is $L = \{ w : \#_a(w) = \#_b(w) \}$ regular?
This can also be proved easily using Myhill-Nerode theorem.

Myhill-Nerode Theorem: Given a language $ L \subseteq \Sigma^* $, Suppose  $$ \forall x,y \in S, (x \neq y) \wedge (\exists z \in \Sigma^*
 ,L(xz) \neq L(yz))   $$ where S is an infinite set. Then L is not a
regular language.

(Here $L(w) = 1$ if $w \in L$ and $L(w) = 0$ if $w \notin L$.)
For the given problem, We have $L=\{w:\#_a(w)=\#_b(w)\}$.
Take $S = a^*$ (note: the set $S$ is infinite).
Now take any two distinct elements from set $S$, $x=a^i$ and $y=a^j$,
and take $z=b^i$.
So $xz \in L$ and $yz \notin L$.
Hence, we will get an infinite number of distinct quotients as $S$ is an infinite distinctive set.
Thus, $L$ is not regular.