The integration of demand side management (DSM) with smart grid (SG) can facilitate residents' transfer into smart homes and sustainable cities by reducing the carbon emission. This manuscript reviews the recent works related to the application of DSM in SG through discussing the techniques and algorithms and their associated challenges for effective implementation. This paper also critically discusses the operation mode of DSM, the profile of energy production, storage and consumption, and finally the benefit obtained by the DSM implementation. Previous literature suggested that DSM practice reduced peak-to-average ratio, energy cost and carbon emission by approximately 10% to 65%, 5% to 50%, and 14%, respectively. The implementation of DSM in SG deals with a number of challenges such as security and privacy, tariff regulation, energy transmission, distribution, and effective utilization of energy resources. A number of international organizations have taken various measures and solutions to guarantee the security and privacy of the DSM in SG discussed. So far, a number of algorithms have been used as optimization approach to solve the DSM optimization problems; however hybrid algorithms have showed better performance than single algorithms due to their faster convergence speed. At the end, the paper presents the research gaps and future research directions.