What are some examples of simple harmonic motion?
Any system that repeats its motion to and fro its mean or rest point
executes simple harmonic motion.
mass spring system
a steel ruler clamped to a bench oscillates when its free end is displaced sideways.
a steel ball rolling in a curved dish
Thus to get S.H.M a body is displaced away from its rest position and then released. The body oscillates due to restoring force. Under the action of this restoring force the body accelerates and overshoots the rest position due to inertia. The restoring force than pulls it back.
The restoring force is always directed towards the mean position and so the is also directed towards the mean or rest position.