Developing environmentally friendly solutions that optimize existing power plants while considering economic factors is crucial for ensuring sustainable energy production and mitigating environmental impact. This study promotes a gas turbine-based power plant design that prioritizes environmental concerns and underscores its versatility. The proposed setup is composed of various components, including a gas turbine, a Rankine cycle (RC), an organic Rankine cycle (ORC), a reverse osmosis (RO) desalination unit, a proton exchange membrane electrolyzer (PEME), and a hydrogen blending module. This system engenders the simultaneous generation of hydrogen, electrical power, and desalinated water. Additionally, the direct utilization of produced hydrogen in the proposed system offers improved technical performance and serves as an effective means to mitigate greenhouse gas emissions. A resilient programming code is formulated to systematically evaluate the system through the lenses of techno-economic and environmental considerations. Incorporating innovative modifications into the existing system resulted in an 8% cost reduction, a 1.2% decrease in carbon dioxide emissions, and a 5% enhancement in exergy efficiency. To attain optimal performance of the system, a data-driven and machine learning methodology is employed, wherein two distinct optimization scenarios are used to define the conditions that yield the utmost system performance. In the first scenario, the optimal values for cost, exergy efficiency, and normalized CO2 emissions have been computed as 39%, 5963 $/h, and 367.4 kg/MWh, respectively. In the subsequent scenario, the optimized system demonstrates the capability to generate a fresh water flow rate of 840.4 kg/s. Concurrently, the cost rate for the system equates to 7054.5 $/h.