I was trying to find matrices non-singular $A$ and $B$ such that $AB = -BA$.I tried taking $A$ and $B$ to be general matrices and started with an order of the matrix as $2$ but I go into a bit of lengthy calculation.
This made me think while it was intuitive for me to calculate the inverse of a $2 \times 2$ , $3 \times 3$ matrix for simple matrices so is it intuitive to find matrices say $A$ such that $A^2 = 0$ or $AB = BA$ or similar type of questions?.
I think such type of interesting generalizations and results can be done and found out?
EDIT - From the answer's below and comments we see that taking the determinants simplifies the problem a bit that it can work only for even order square matrices but still a way/ hint to guessing it would help?
Taking the determinant on each side shows that it can't be done in odd dimensions (remember the exponent in $\det(\lambda A)=\lambda^n\det(A)$).
As for even dimensions, you can take $$A=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\\B=\begin{bmatrix}1&0\\0&-1\end{bmatrix}$$for $2\times2$, and quite easily build general $2n\times2n$ using these two (and a lot of zeroes) as building blocks.
As for the general question of "Finding matrices such that", for me it's mostly guessing and geometric intuition (at least if the relation we want is simple enough). In this case, for instance, I found $A$ and $B$ by thinking about rotating and flipping the plane, and what that does to the two axes, rather than actually doing any calculations and solving equations. I guessed, checked, and got lucky.
As another example, take $A^2=0$. Start with $2\times2$. Then $A$ must be singular, so it must have a kernel. Let's say the $x$-axis, which makes the first column of $A$ into $[0,0]^T$. So, what to do with the $y$-axis? If we send that to the origin too, then $A=0$, which is boring. However, we want $A^2=0$, so whatever we do to the $y$-axis, it should be sent to the kernel, i.e. the $x$-axis. This makes $[1,0]^T$ a possible second column of $A$, and we have our example.