https://people.maths.bris.ac.uk/~csxam/teaching/qc2020/lecturenotes.pdf
Applying the above construction to AND we get the map $(x1,x2,y) \rightarrow (x1,x2,y⊕(x1∧x2))$ for $x1,x2,y \in \{0,1\}$. The unitaryoperator which implements this is then simply the map $|x1〉|x2〉|y> \rightarrow |x1〉|x2〉|y \oplus (x1∧x2)〉$.
Written as a matrix with respect to the computational basis this is
$$\begin{bmatrix} 1&0&0&0&0&0&0&0\\0&1&0&0&0&0&0&0\\0&0&1&0&0&0&0&0\\0&0&0&1&0&0&0&0\\0&0&0&0&1&0&0&0\\0&0&0&0&0&1&0&0\\0&0&0&0&0&0&0&1\\0&0&0&0&0&0&1&0 \end{bmatrix}$$
How can you just spot what the matrix is with respect to the computational basis?
Each column of a quantum gate can be interpreted as the result from feeding in one of the standard 0-1 configurations of your system of qubits.
For example, the configuration corresponding to the $5$th column is $|101\rangle$ (since $5$ is $101$ in binary), so that $x_1 = 1$, $x_2 = 0$, $y = 1$. With that, we see that the corresponding output should be $$ |x_1 \rangle |x_2 \rangle |y \oplus (x_1 \land x_2) \rangle = |1 \rangle |0 \rangle |1 \oplus (1 \land 0) \rangle = |101\rangle. $$ This is represented by the vector with a $1$ in the $5$th spot and $0$s elsewhere.
Repeat this for the remaining columns. In other words, finding the matrix associated with the gate is as easy as filling out a truth table.
In this case, we could save a bit of time if we notice that the input remains unchanged except in the case where $x_1 = x_2 = 1$, which tells us that we must have a leading identitity matrix up until the bottom right $2 \times 2$ corner.