the diagonal in the rectangle splits it into two right angled triangles, hence the hypotenuse is the diagonal.
once you find the measurement, we all know that a square has all sides equal and the diagonal splits it into 2 equilateral triangles. so, the side of the square =the diagonal's measurement.