Find diagonalizable and nilpotent parts of matrix

Let B = $\begin{bmatrix}1 & -2\\\ 2& -3\\\end{bmatrix}$ I found the jordan form BQ = QJ, where Q = $\begin{bmatrix}2 & 1\\\ 2& 0\\\end{bmatrix}$ and J = $\begin{bmatrix}-1 & 1\\\ 0& -1\\\end{bmatrix}$ Now I have to find a diagonalizable matrix $D$ and nilpotent matrix $N$, such that $DN = ND$ and $B = D + N$. How do I solve that in general? I found, by luck, that $D = -I$ and then $N = B - (-I)$. Can someone help me? Thanks

We can generalize your method: we have $$B=QJQ^{-1}$$ and $$J=\operatorname{diag}(\lambda_1,\ldots,\lambda_n)+N'$$ where $N'$ is a strictly triangular matrix so nilpotent hence $$B=D+N$$ where $$D=Q\operatorname{diag}(\lambda_1,\ldots,\lambda_n)Q^{-1}$$ is diagonalizable and
$$N=QN'Q^{-1}$$ is nilpotent.