How do I raise a matrix to the infinite power? I know that the main method for doing this is by diagonalizing the matrix, but what if I can't?
For example, let's say I have the matrix
\begin{bmatrix}0&0&0&0&0\\2/3&0&0&0&0\\1/3&0&1&0&0\\0&3/7&0&1&0\\0&4/7&0&0&1\end{bmatrix}
You can see that when I try diaganolizing the matrix in Mathematica, the eigenvector matrix is singular, so I'm unable to take its inverse.
However, I know that when I raise this matrix to the power of infinity, I know I get the following matrix
\begin{bmatrix}0&0&0&0&0\\0&0&0&0&0\\1/3&0&1&0&0\\2/7&3/7&0&1&0\\8/21&4/7&0&0&1\end{bmatrix}
Is there any general algorithm or formula or steps I can take to get there?

This depends on the spectral radius $\rho(M)$ of your matrix $M$.