The force for a spring with displacement $\vec{x}$, spring constant k is $\vec{F}(x)=-k\vec{x}$ (Hook's Law).
From Newton's law $\vec{F}=m \vec{a}=m \frac{d^2 x}{dt^2}$
So $m \frac{d^2x}{dt^2}=-k x$.
The solution of the above equation is $x=A \sin\omega t$.
Since $\frac{dx}{dt}= A \omega \cos\omega t$, $\frac{d^2x}{dt^2}= -A \omega^2 \sin\omega t=-\omega^2 x$
So $\omega=\sqrt{\frac{k}{m}}$.
If the spring is moved away equilibrium position, it will move with displacement similar to $x=A \sin\omega t$, which is called simple Harmonic motion (SHM).

The following applet shows relation betweeb simple harmonic motion and spring motion. $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$, $x(t)=a*\sin(\omega t), y(t)=b*\cos(\omega t)$

The uniform circular motion is intimately related to a simple harmonic motion.
If we were to look at a side view of the uniform circular motion
on a thumbtack stuck on a rotating table,
we would see the thumbtack oscillate in simple harmonic motion.

Press Start to begin the animation.
The black dot will move in uniform circular motion.

Watch and find out the relation between uniform circular motion and simple harmonic motion.

Press left mouse button to suspend the animation, press it again to resume.

Did you find out the frequency of the uniform circular motion?

The red arrow represents the velocity of the black dot.

The yellow arrow and the blue arrow are components of the above velocity vector.

Did you know when the thumbtack has maximum velocity ?

If you click the left mouse button within the dark-gray area , and drag the mouse button left/right,

you can rotate the circle about the vertical axis. (sample picture)

You can rotate the circle 90 degree => side view of the motion.

( This feature was added as a request from B. Surendranath Reddy.)