SHM (Simple Harmonic Motion) is an oscillation motion that is in the simplest form.
In this motion, the motion arises when the force is directly proportional to the displacement from the mean position. The mean position is also the equilibrium position.
Consider a spring that is attached at one end. It is in its equilibrium position when no force is applied to it.
When we pull it outwards, the string exerts a force that is directed toward the equilibrium position.
And, if we push the spring inwards, the string exerts a force towards the equilibrium position.
In each case, we can see that the spring's force is directed toward the equilibrium position; this force is known as the restoring force. Let be the force and be the displacement of the string from the equilibrium position.
As a result, the restoring force will be (the negative sign indicates that the force is in the opposite direction). In this case, denotes the force constant.
The SHM in the pendulum is shown in the given figure: