Given a matrix $$x = \begin{bmatrix} 40 & 0 & 0 & 0\\ 0 & 80 & 100 & 0 \\ 0 & 40 & 120 & 0 \\ 0 & 0 & 0 & 60\end{bmatrix}$$
How to find the inverse of that matrix? What I know: $\det(x) = ac-bd$, inverse of a 2x2 matrix: $$x^{-1} = \frac{1}{\det(x)}\cdot \begin{bmatrix} d &-b\\ -c &a\end{bmatrix}.$$
There is a lot of content online; however none of them has a specific numerical example.
Block diagonal matrices can be inverted block by block. See also [*].
In your example:
$$\begin{bmatrix} 40 & 0 & 0 & 0 \\ 0 & 80 & 100 & 0 \\ 0 & 40 & 120 & 0 \\ 0 & 0 & 0 & 60\end{bmatrix}^{-1} = \begin{bmatrix} [40]^{-1} & \begin{matrix} 0 \quad & 0\quad \end{matrix} & 0 \\ \begin{matrix} 0 \\ 0 \end{matrix} & \begin{bmatrix} 80 & 100 \\ 40 & 120 \end{bmatrix}^{-1} & \begin{matrix} 0 \\ 0 \end{matrix} \\ 0 & \begin{matrix} 0\quad & 0\quad \end{matrix} & [60]^{-1} \end{bmatrix}. $$
Can you take it from here?