Transforming the Future: The Power of Smart Grid Technologies for Energy Optimization