In recent years, both sustainability and optimization concepts have become inseparable developing topics with diverse concepts, elements, and aspects. The principal goal of optimization is to improve the overall sustainability including the environmental sustainability, social sustainability, economic sustainability, and energy resources sustainability through satisfying the objective functions. Therefore, applying optimization algorithms and methods to achieve the sustainable development have significant importance. This paper represents a considerable review on the employed optimization methodologies to sustainability and the sustainable development including sustainable energy, sustainable buildings, and sustainable environment. Since energy optimization is one of the major necessities of sustainability, sustainable development is investigated from the energy perspective. In addition, the concept, definitions, and elements of the sustainability and optimization have been presented, and the review of the optimization metaheuristic algorithms used in recent published articles related to sustainability and sustainable development was carried out. Thus, it is believed that this paper can be appropriate, beneficial, and practical for students, academic researchers, engineers, and other professionals.