Of course you must have some means to measure the equilibrium. In aqueous solution, we address the equilibrium:

#HA(aq) + H_2O(l) rarr A^(-) + H_3O^+#

Given a #"glass electrode"#, an electrode sensitive to #H_3O^+#, we can measure the concentration of #H_3O^+#, which given the stoichiometry of the reaction is equal to the concentration of #A^-#, and the starting concentration of #HA# should also be known. And thus:

#K_a=([A^-][H_3O^+])/([HA])#

And so if (say) the glass electrode gives a value for #[H_3O^+]#, say #[H_3O^+]=x#.

And thus: #K_a=(x^2)/([HA]-x)#.

This is quadratic in #x#, that may be solved exactly, given that we know the starting value of #[HA]#. Typically, simple approximations are used so we do not have to pfaff about with quadratics, i.e.

#x_1~=sqrt(K_a[HA])#

Successive approximations (#x_1, x_2, x_3#) rapidly give a value for #x# that is identical to the value that would be obtained by the quadratic equation.