Please teach me to solve linear equations with the matrix system.

Hello, how are you doing.

could you please post an example teaching me how to solve a linear equation of 3X3 you know 3 rows and 3 colums when solving with matrices, I don't understand very well what's our goal when solving linear equations with the matrix system, some books tell me that the goal is to end up with 3 zeros like this:

a b c d

0 e f g

0 0 h i

but in other textbooks I find that our goal is also to arrive at a matrix with some diagonal 1's like this

1 b c d

0 1 f g

0 0 1 i

so, what's our goal? is it really important fo finish with those 1's? if you could please post an example explaining for me very slowly how to solve this type of exercises.

thank you.