Smart Grid Technology: Optimizing Energy Distribution for Sustainability