The simplest method is to first diagonalise $A$. Then consider in turn each eigenvalue $\lambda$ and a basis of the associated eigenspace $\mathcal{E}_\lambda$: $\newcommand{\ket}[1]{|{#1}\rangle}(\ket{1},\ket{2},\cdots,\ket{n})$. You then construct the matrix $\newcommand{\bra}[1]{\langle{#1}|}M_B=(\bra{i}B\ket{j})_{1\le i,j \le n}$. There is one such matrix for each eigenvalue $\lambda$, just to be crystal clear, but I will refrain from tagging a $\lambda$ to $M_B$ to keep the notation readable. Finally you diagonalise $M_B$. This will gives you eigenvalues $\mu_1, \cdots, \mu_n$ (not necessarily distinct) and eigenvectors $u_i$, which are column vectors,
$$u_i=\begin{pmatrix} u_{i1}\\ \vdots \\u_{in} \end{pmatrix},$$
such that $M_Bu_i=\mu_iu_i$. Then you construct $\ket{i'}=\sum_j u_{ij}\ket{j}$, and now $(\ket{1'}, \cdots, \ket{n'})$ are eigenvectors for both $A$, all for the eigenvalue $\lambda$, and for $B$, for the respective eigenvalues $\mu_1,\cdots,\mu_n$.
Of course, if $\lambda$ was not degenerate in the first place, i.e. $n=1$, then there is nothing to do! If it is degenerate, most often, $n$ will be small, at least way smaller than the dimension of the eigenproblem for $A$, so the diagonalisation of $M_B$ will be comparatively easy. Then, again, don't forget you have to do this for each eigenvalue $\lambda$ of $A$. Of course, you could start by diagonalising $B$ instead: just do what looks simpler.
There are way more efficient numerical methods note, which would make a big difference for large matrices, but for your bread and butter quantum system, the method I highlighted should be tractable.