Consider the subspace $W = \{ A \in M_{n \times n}(F) : tr(A) = 0\} = \{ A \in M_{n \times n}(F) : \sum_{i=1}^{n} A_{ii} = 0\}.$ Now, we apply the standard representation of $M_{n \times n}(F)$ with respect to the matrix units $\beta,$ which is an isomorphism $\phi_{\beta}$ from $M_{n \times n}(F)$ onto $F^{n^{2}}.$ Namely, we express each element of $W$ as a coordinate vector relative to $\beta,$ i.e.,
$$\phi_{\beta}(W) = \{ (A_{11},A_{12},\dots,A_{21},A_{22},\dots,A_{nn}) \in F^{n^{2}} : \sum_{i=1}^{n} A_{ii} = 0\}.$$
Next, we encode the linear constraint $\sum_{i=1}^{n} A_{ii} = 0$ into the following matrix
$$B = \begin{pmatrix} 1 & 0 & \cdots & 0 & 1 & \cdots & 1\end{pmatrix},$$
since the solution set of the corresponding homogeneous system:
$$B \begin{pmatrix} A_{11} \\ A_{12} \\ \vdots \\ A_{21} \\ A_{22} \\ \vdots \\ A_{nn} \end{pmatrix} = 0$$
satisfies the constraint. Now, we identify the solution set as the null space $N(B),$ then we apply the dimension theorem ($dim(N(B)) = nullity(B) = dim(F^{n^{2}}) - rank(B)$). Thus, the problem is to find a subset of the null space with exactly $n^{2} - 1$ linearly independent vectors.
To obtain this subset, we identify the $B_{11} = 1$ entry as the pivot variable. Next, we identify the remaining entries as the free variables. Then, we obtain a solution
$$\{ (0,1,\dots,0,0,\dots,0),\dots, (-1,0,\dots,0,1,\dots,0),\dots,(-1,0,\dots,0,0,\dots,1)\},$$
where we have expressed the vectors as $n^{2}$-tuples. Lastly, we apply the inverse of the standard representation $\phi_{\beta}^{-1}$ to the solution in order to return square matrices instead of coordinate vectors.