PDA for the language of strings containing the same number of a and b Need idea for solving the following pushdown automata:

$\mathcal{L}=\{w\in\sum ^* | \#a(w)=\#b(w),|w|\geqslant 0\}  \,\,\,\, \sum=\{a,b\}$

In the beginning I thought to PUSH A for input a, and then to POP A for input b, but it doesn't work well for the word ba for example
You have solved half of the task. Now push $B$ for $b$ and pop $B$ for $a$.
To decide which operation to do, handle empty stack, pushing symbol when it is empty and popping otherwise.