This paper introduces a mutual authentication protocol designed for the IoT-Fog-Cloud environment, utilizing Elliptic Curve Cryptography (ECC). The proposed protocol supports the management of energy consumption and network usage. Smart energy management not only helps to reduce energy costs but also minimizes carbon emissions. Hence, it achieves sustainability. The protocol undergoes rigorous formal and informal security analyses and has proven to achieve session key security along with mutual authentication. Formal security analysis is conducted using ProVerif, while informal assessments reveal the protocol's resilience against various attacks, including replay attacks, session key disclosure attacks, man-in-the-middle attacks, traffic analysis attacks, Denial-of-Service (DoS) attacks, desynchronization attacks and ESL attacks. Additionally, it provides perfect forward secrecy. The protocol incurs a computational cost of 14.88 milliseconds and requires 5824 bits for message exchange, keeping security as the top priority ensures swift and secure interaction between IoT devices and fog nodes. Also, simulation has been done using iFogSim to assess the practicability of the proposed scheme in real-life scenarios. The energy consumption, network usage, application loop delay, and execution time of various configurations are computed and compared. Compared to existing protocols, the proposed one confirms provable security and offers enhanced security features in the IoT-Fog-Cloud environment.