That’s a rather strange suggestion on the part of your teacher, since there are much more straightforward examples, but it can be made to work. The version of the diagonalization that I think you have in mind argument constructs a non-terminating decimal that differs from each row from the diagonal entry in that row. In order to conclude that this decimal actually represents a real number not in your list, you must first show that it represents a real number. Let’s say that the decimal expansion looks like this: $0.d_1d_2d_3\ldots~$. We understand this to mean $\sum_{k\ge 1}\frac{d_k}{10^k}$, but that infinite series is really an abbreviation for
$\lim_{n\to\infty}\sum_{k=1}^n\frac{d_k}{10^k}\;,\tag{1}$
if it exists. Let $s_n=\sum_{k=1}^n\frac{d_k}{10^k}\;,$ the $n$-th partial sum; it’s these partial sums are all rational, and it’s easy enough to show that $s_1\le s_2\le s_3\le\ldots~$, but how do you know that the limit in $(1)$ exists? In other words, what guarantees that this $0.d_1d_2d_3\dots$, the one that disagrees with the diagonal in every row, actually represents a real number at all?