If either of the events has infinite cardinality, then it is clear that the number of ways to perform A and then B will also be infinite. So, assume that both |A| and |B| are finite. In order to count the successive events, enumerate the elements in each set
\begin{gather*}
A = \left \{ a_1, a_2, a_3, ... , a_{|A|} \right \}\\
B = \left \{ b_1, b_2, b_3, ... , b_{|B|} \right \}
\end{gather*}
and consider the function f(k,j) = (k-1)|B| + j. This function is one-to-one and onto from the set
\begin{equation*}
\left \{ (k,j): 1 \le k \le |A|, 1 \le j \le |B| \right \}
\end{equation*}
onto
\begin{equation*}
\left \{ s : 1 \le s \le |A| |B| \right \}.
\end{equation*}
Since this second set has |A| |B| elements then the conclusion follows.