Due to the increasing need to find alternative fuels to restrict the use of oil in the world, substantial alternative sources have been identified. One of these alternative sources is hydrogen. Hydrogen is produced through an electrochemical process. The purpose of this paper is to model an electrochemical process and to determine the yields or losses of process efficiency by increasing or decreasing the water supply temperature. For the adaptation of the environmental process, the electricity required for the electrolyzer is supplied from a geothermal unit. For the sake of achieving the desired goals, the geothermal unit has been modeled and various parameters have been investigated. In this paper, an analysis of energy and exergy thermodynamics, as well as the exergy-economic analysis of the proton exchange membrane (PEM-type) electrolysis process for hydrogen production, which derives its driving power from ground-based power has been carried out. For this purpose, the required work is generated from the geothermal source by the Rankine cycle. The resulting work is used as an input for the electrolysis process and electrolysis water is preheated by geothermal sewage treatment. Funtional parameters based on the first and second thermodynamic rules are determined for the system and the performance of the system has been evaluated. The effects of geothermal water temperature and electrolysis on the amount of generated hydrogen have been studied and it has been shown that these parameters have a correlation with each other. Also, energy, exergy and thermo-economic analysis methods have been carried out by using MATLAB software.