Four. (25 points)
As shown in Figure 4, in the Cartesian coordinate system, points $A$ and $B$ are two points on the graph of a certain linear function, satisfying $\angle A O B=90^{\circ}$, and $A O=B O=2$. If the angle between $A O$ and the $y$-axis is $60^{\circ}$, find this linear function.
Four, draw perpendiculars from points $A$ and $B$ to the $x$-axis, intersecting the $x$-axis at points $M$ and $N$ respectively. Then
$$
\angle A O M=30^{\circ}, \angle B O N=60^{\circ} \text {. }
$$

Therefore, $A M=\frac{1}{2} A O=1$,
$$
O M=\sqrt{A O^{2}-A M^{2}}=\sqrt{3} \text {. }
$$

Similarly, $B N=\sqrt{3}, O N=1$.
Thus, $A(-\sqrt{3}, 1)$ and $B(1, \sqrt{3})$.
Let the linear function be $y=k x+b$. Substituting the coordinates of points $A$ and $B$ gives
$$
\left\{\begin{array} { l } 
{ 1 = - \sqrt { 3 } k + b , } \\
{ \sqrt { 3 } = k + b }
\end{array} \Rightarrow \left\{\begin{array}{l}
k=2-\sqrt{3}, \\
b=2 \sqrt{3}-2 .
\end{array}\right.\right.
$$

Hence, the linear function is $y=(2-\sqrt{3}) x+2 \sqrt{3}-2$.