Why magic square problem algorithm works ?

Problem :- https://en.wikipedia.org/wiki/Magic_square

Any proof for the algorithm of problem why the algorithm works ?

@ankitgupta.1729 yes sir

@ankitgupta.1729 sir yes the way you tried that is elegent please sir take your time and I will also try to by my own if got any thing I will add.

@Kabir5454 can you please check that link again ? Let me know if you have any concerns.

I think there are more than one method to solving magic square ankit sir will clear this.