Consider the parallelogram shown below.
The lengths of the sides are a and b.
The lengths of the diagonals are 2x and 2y.
Because the diagonals are both congruent and perpendicular, therefore there are two right triangles as shown.
Note that x = y.
Because x = y, each right triangle is isosceles and has the angles 90°, 45° and 45°.
From the Pythagorean theorem,
For one right triangle,
a² = x² + y² = x² + x² = 2x².
For the other right triangle,
b² = y² + x² = x² + x² = 2x²
Therefore
a² = b²
a = b
It follows that all sides of the parallelogram are equal and each angle is
45+45 = 90°
Therefore the parallelogram is a square.