Theorem: Let $H,K$ be Hilbert spaces, not necessarily separable, and $T:H\to K$ compact (for simplicity, we assume it not to have finite rank, otherwise we need to modify the proof slightly). Then there are orthonormal systems $(e_j)_{j\in\mathbb N}$ in $H$, $(f_j)_{j\in\mathbb N}$ in $K$ and a positive sequence $(s_n)_{n\in\mathbb N}$ with $\lim\limits_{n\to\infty}s_n = 0$ such that $$Tx = \sum_{j=0}^\infty s_j\langle x,e_j\rangle f_j$$ for each $x\in H$. Moreover, the ${s_j}^2$ are exactly the nonzero eigenvalues of $T^\ast T$.
Proof: The operator $T^\ast T:H\to H$ is compact and self-adjoint, hence, by the spectral theorem, there is an orthonormal system $(e_j)_{j\in\mathbb N}$ such that $$T^\ast Tx = \sum_{j=0}^\infty\lambda_j \langle x,e_j\rangle e_j,$$ for each $x\in H$, where the $\lambda_j$ are exactly the nonzero eigenvalues of $T^\ast T$, hence $\lim\limits_{j\to\infty}\lambda_j = 0$ and $\lambda_j>0$ for each $j\in\mathbb N$ since $T^\ast T$ is self-adjoint and positive. Set $s_j := \sqrt{\lambda_j}$ and $f_j := \frac{Te_j}{\|Te_j\|}$. This is well defined because $T$ can't vanish on $e_j$, otherwise $T^\ast T$ would also vanish on $e_j$ but $e_j$ is an eigenvector for a nonzero eigenvalue of $T^\ast T$.
$(f_j)_{j\in\mathbb N}$ is an orthonormal system because $\langle Te_j, Te_k\rangle = \langle T^\ast Te_j, e_k\rangle = \lambda_j\langle e_j,e_k\rangle = 0$ for $j\neq k$ and $\|f_j\| = 1$ is obvious.
Define $S:H\to K, x\mapsto \sum_{j=0}^\infty s_j\langle x,e_j\rangle f_j$. We claim that $T=S$. Since $S$ and $T$ are both continuous, it suffices to check the equality on an orthonormal basis of $H$.
Therefore, let $(e_j)_{j\in J}$ be an orthonormal basis of $H$ that contains $(e_j)_{j\in\mathbb N}$, i.e. $\mathbb N\subset J$. If $j\in J\setminus \mathbb N$, then $T^\ast Te_j = 0$. It follows $\|Te_j\|^2 = \langle Te_j, Te_j\rangle = \langle T^\ast Te_j, e_j\rangle = 0$, hence $Te_j = 0$ and also $Se_j=0$ because $\langle e_j, e_k\rangle = 0$ for each $k\in\mathbb N$.
If $j\in \mathbb N$, then $Se_j = s_j f_j = s_j\frac{Te_j}{\|Te_j\|}$, so it suffices to show ${s_j}^2 = \|Te_j\|^2$. This is correct because $\|Te_j\|^2 = \langle T^\ast Te_j, e_j\rangle = \lambda_j\langle e_j, e_j\rangle = {s_j}^2$.