In the recent decade, due to the increasing dependency of communities on energy, the issues related to optimal operation and energy management have been increasingly considered by researchers and beneficiaries in this field. In this regard, the subject of energy can be regarded as the critical challenge of humankind in the present century, including economic, environmental, and security contexts. The proposed solution to address these challenges is to move toward smart energy systems and utilizing renewable energy resources and energy storage systems, which have been introduced and discussed in various aspects in recent years. The power-to-X (P2X) facilities are a new framework for energy conversion technologies to improve energy systems’ optimal operation. Interconnected hybrid energy systems (IHESs) along with P2X facilities containing power-to-heat (P2H), power-to-cool (P2C), and power-to-hydrogen (P2Hy) technologies can supply disparate demands of energy systems locally. Also, IHESs can trade energy with each other, in addition to meeting individual demands. This approach improves systems’ efficiency, flexibility, and performance and reduces greenhouse gas emissions. In this chapter, the optimal coalition operation of IHESs using renewable and nonrenewable energy resources to mitigate operation and emission costs has been investigated. For more comparison, two case studies are considered. In the first case study, the individual optimal operation of each hybrid energy system (HES) is taken into account. In the second one, the optimal coalition operation of IHESs is modeled. The mixed-integer linear programming (MILP) optimization problem is solved in GAMS software under the CPLEX solver. The obtained results indicate that the interconnected operation of the HESs improves system performance and reduces system operating costs.