Let $A(-2;-2)$ and $B(4;4)$ are vertices of the square $ABCD$. If the intersection of the diagonals of the square lies in the second quadrant, find its coordinates.
I am not sure what exactly we are supposed to use in order to find the center $O$ of the square.
I found that the equation of the line through $A,B$ is $$AB:y=x$$ $AD$ lies on a line perpendicular to $AB$ and passing through $A$, so it has an equation $$AD:y=-x+n$$ and $-2=2+n\Rightarrow n=-4\Rightarrow AB:y=-x-4.$. Therefore we can write the coordinates of $D$ as $D=(x;-x-4)$. $O$ is the midpoint of $BD$, so $O=\left(\dfrac{x+4}{2};\dfrac{-x}{2}\right)$. Now $\vec{OA}.\vec{OB}=0$ and from here we can actually find $x$ and from there the coordinates of $O$, but I seem to always mess up the calculations as I got $x=-16$ or $x=0$ which isn't the case (we can see it from the diagram). Is there something more direct?

Length of the line segment AB from your diagram is :$\sqrt{(4-(-2)^2+4-(-2)^2}=6\sqrt{2}$
Mid point $(M)$ of this line segment is at: $(\frac{(4-2)}{2},\frac{(4-2)}{2})=(1,1)$
$AM=MB=3\sqrt2$
$MO=\frac{AD}{2}=\frac{AB}{2}=3\sqrt2$; since $AD=AB$
Equation of $AB$ as you found it is $y=x$
Now perpendicular distance of the point M from the center is $3\sqrt2$, i.e M is the foot of perpendicular of the center on line AB.
Thus:$$\frac{1-x_1}{1}=\frac{1-y_1}{1}=-\frac{(y_1-x_1)}{1^2+1^2}$$
Where $(x_1,y_1)$ are the coordinates of the center.
$1-\frac{3x_1}{2}=-\frac{y_1}{2} \ \ \ ....(1)$
$1-\frac{y_1}{2}=\frac{x_1}{2} \ \ \ ....(2)$
These will be sufficient to get you an answer.