What does it mean for an operator to be diagonal with respect to an orthonormal basis? Suppose that you have a seperable Hilbert space, $H$, an orthonormal basis of $H$, $(e_n)$, and the set $D=\{T\in B(H):T\,\text{is diagonal with respect to the basis}\,(e_n)\}$.
Problem: What, exactly,  does it mean to say that an operator is diagonal with respect to an orthonormal basis?
As a particular example, if you were to take two operators in this space, say, $S,T\in D$, how would you verify that the composition $S\circ T$ was also in $D$? Which properties of an operator being in $D$ would you be checking this product against?
 A: It means that $Te_n=\lambda_n e_n$ for some values $\lambda_n$. If you write down the operator as a matrix w.r.t. that basis, it would be a diagonal matrix.
Stated differently, all $e_n$ are eigenvectors of $T$. The $\{e_n\}$ are an eigenbasis of $H$ w.r.t. $T$.

If $S,T\in D$, then $STe_n=\lambda^T_n Se_n=\lambda^S_n\lambda^T_n e_n$. So yes, $ST\in D$ again.
A: This means that the set of vectors $e_i$ are eigenvectors of the operator, i.e. there exists a set of values $\lambda_i$ such that 
$$Te_i = \lambda_i e_i.$$
In your example, suppose that both $S$ and $T$ verify the above, with possibly different eigenvalues $\sigma_i$ and $\tau_i$, then for every vector in your basis you have
$$S(T e_i) = S(\tau_i e_i) = \tau_i Se_i = \tau_i\sigma_i e_i$$
Therefore the composition $ST$ also belongs to your set $D$, with the product of eigenvalues of $S$ and $T$.
Note that I used the word vector but I suppose you understand how to treat general vector spaces. Also, orthonormality is not needed.
A: It means: $T \in D \iff $ each $e_n$ is an eigen vector of $T$.
