Buildings account for a significant amount of energy consumption leading to the issues of global emissions and climate change. Thus, energy management in a building is increasingly explored due to its significant potential in reducing the overall electricity expenses for the consumers and mitigating carbon emissions. In line with that, the greater control and optimization of energy management integrated with renewable energy resources is required to improve building energy efficiency while satisfying indoor environment comfort. Even though actions are being taken to reduce the energy consumption in buildings with several optimization and controller techniques, yet some issues remain unsolved. Therefore, this work provides a comprehensive review of the conventional and intelligent control methods with emphasis on their classification, features, configuration, benefits, and drawbacks. This review critically investigates the different optimization objectives and constraints with respect to comfort management, energy consumption, and scheduling. Furthermore, the review outlines the different methodological approaches to optimization algorithms used in building energy management. The contributions of controller and optimization in building energy management with the relation of sustainable development goals (SDGs) are explained rigorously. Discussions on the key challenges of the existing methods are presented to identify the gaps for future research. The review delivers some effective future directions that would be beneficial to the researchers and industrialists to design an efficiently optimized controller for building energy management toward targeting SDGs.