There are three easy tests to check if a transformation is canonical. Note
that some multiplicative constants might pop up in certain textbooks, depending
on the exact definition of canonical transformation.
Notation
Let $x = (p, q)$ be the $2n$ variables, and the transformed variables be $\tilde{x}(x) =
(\tilde{p}(p, q), \tilde{q}(p, q))$.
The method of the symplectic jacobian
Let $J = \partial \tilde{x} /\partial x $ be the Jacobian matrix of the
transformation. Moreover, let $\mathbb{E}$ be a $2n \times 2n$ block matrix
$$
\mathbb{E} =
\begin{pmatrix}
0 & 1 \\
-1 & 0
\end{pmatrix}
$$
Then the transformation is canonical if and only if
$$
J\mathbb{E}J^T = \mathbb{E}
$$
The method of Poisson brackets
The transformation is canonical if and only if the fundamental Poisson
brackets are preserved
$$
\{\tilde{p}_i, \tilde{p}_j\} = 0 \qquad
\{\tilde{q}_i, \tilde{q}_j\} = 0 \qquad
\{\tilde{q}_i, \tilde{p}_j\} = \delta_{ij}
$$
The method of the Liouville differential form
This is somewhat less practical, but I include it for completeness.
The transformation is canonical if and only if the differential form
$\sum_i p_i \mathrm{d}q_i - \sum_i \tilde{p}_i \mathrm{d}\tilde{q}_i$
is closed.