Addressing the growing energy demand in a sustainable manner is one of the most pressing global challenges today. Achieving this requires optimizing the efficiency of energy storage and conversion systems while aligning with green chemistry principles to minimize environmental impact. In this context, this work explores both theoretically and experimentally how the structure of porous carbon materials, synthesized from renewable or low-impact precursors, and used as electrodes in metal-air batteries (e.g., Na-air, Li-air), affects the physicochemical properties of confined electrolytes. Specifically, we investigate various structural and physicochemical properties of LiTfO (Lithium triflate) and NaTfO (Sodium triflate) salts dissolved in 1,2-Dimethoxyethane (DME), which are common electrolytes in lithium and sodium batteries. Using molecular dynamics (MD) simulations, we calculated the density, self-diffusion coefficients (DDM), conformer distributions, and radial distribution functions (RDF), analyzing how these properties change with pore size. These simulations were complemented by experimental measurements of self-diffusion coefficients using conductivity (DCON) and NMR (DRMN), revealing significant differences between the confined and bulk electrolytes. The incorporation of sustainable practices in material synthesis and design reinforces the environmental and operational benefits of the developed electrodes. Our findings highlight the critical importance of understanding the physicochemical behavior of electrolytes under the confinement of carbonaceous electrode materials, thereby guiding the design of greener, more efficient energy storage devices.