A square has four equal sides and two equal diagonals. If you compute all six pairwise distances between four points, you should see exactly two distinct values: four instances of the side length and two instances of the diagonal length.
The diagonal length should be side × √2 by the Pythagorean theorem. You can verify this or just check that you have exactly two unique distances with counts 4 and 2.
Also check that no two points are identical (distance zero). If they are, it cannot be a square.