Simple harmonic motion(SHM) is defined as when an object goes back and forth along the same straight line.
Simple harmonic motion occurs under the influence of a restoring force proportionate to its displacement from the mean position, a particle or object moves back and forth within a stable equilibrium position.
The direction of this restoring force is always towards the mean position.
Some examples of simple harmonic motion are as follows:
Oscillating pendulum.
The vibration of the eardrum.
The motion of a spring.
Swing in the park.
Spring-mass system.
An illustrative diagram of simple harmonic motion in the oscillating pendulum is given below.