How is new equilibrium struck when supply or demand curve tends to shift?

When supply or demand curve tends to shift, new equilibrium is struck through the process of extension and contraction of demand and supply. Generally, any change in demand and supply will cause a situation of either excess demand or deficient demand in relation to supply of the commodity. In a situation of excess demand (D>S), price will tend to rise causing contraction of demand and extension of supply.
This process will continue till new price is reached where demand equals to supply. Likewise in a situation of deficient demand (D<S), price will tend to fall causing extension of demand and contraction of supply. This process will continue till new’ price is reached where demand equals to supply.