Thanks and one more doubt. I saw that there are about 3/4, those in which cases would they be used?
Everything depends on the measurement of the gas intake in the wall and the gas inlet of the water heater (and that depends on the consumption of the appliance). In your case the measure of the entrance of the water heater is ½.
If the existing epoxy pipe is ¾, you should see if there is a reduction just at the entrance of the water heater, you could leave that reduction and buy a flexible de to replace the pipe section (always taking into account that the types of threads correspond, since a flexible is male / female and a tube is male / male)
All this if it is after the stopcock, and not with a flexible mesh.