Hey @Pradeep Sharma16,
When the inflation rate rises, speculation among investors happens across the market assuming that the prices of the shares will drop in the near future and hence they look out to sell their shares fearing a drop in the market price.
Also, optimistic investors might buy the stocks which cause a volatile environment.
Hope this helps!