The following matrix is my desired matrix form :
I attempted to use the nice matrix environment since it offers a solution encircling/squaring rows and elements as seen in this photo above. The only problem is that I couldn't find a way to obtain the blocked partition as seen in the photo and I have scanned this manual https://ctan.math.illinois.edu/macros/latex/contrib/nicematrix/nicematrix.pdf and their partitioning of the matrix would look like two lines intersecting each other different from what I need here in this photo. Therefore, I would hope someone could assist me in writing a code to obtain this matrix as it is in this photo and I would be very much thankful.

