Given YA = B, you can solve for Y by multiplying by A ⁻¹ on the right (on both sides of the equation). So we have
YA = B ==> (YA) A ⁻¹ = BA ⁻¹ ==> Y (AA ⁻¹) = BA ⁻¹ ==> Y = BA ⁻¹
provided that the inverse of A exists. In this case, det(A) = 5 ≠ 0, so the inverse does exist, and
[tex]A=\begin{bmatrix}-1&-4\\0&-5\end{bmatrix} \implies A^{-1}=\dfrac1{\det(A)}\begin{bmatrix}-5&0\\4&-1\end{bmatrix} = \begin{bmatrix}-1&0\\\frac45&-\frac15\end{bmatrix}[/tex]
Then
[tex]Y=\begin{bmatrix}5&-5\\8&-8\end{bmatrix}A^{-1} = \begin{bmatrix}-5&5\\-8&\frac{24}5\end{bmatrix}[/tex]