Hydrogen embrittlement can be prevented through several methods, all of which are centered on minimizing contact between the metal and hydrogen, particularly during fabrication and the electrolysis of water. Embrittling procedures such as acid pickling should be avoided, as should increased contact with elements such as sulfur and phosphate.
If the metal has not yet started to crack, hydrogen embrittlement can be reversed by removing the hydrogen source and causing the hydrogen within the metal to diffuse out through heat treatment. This de-embrittlement process, known as low hydrogen annealing or "baking", is used to overcome the weaknesses of methods such as electroplating which introduce hydrogen to the metal, but is not always entirely effective because a sufficient time and temperature must be reached. Tests such as ASTM F1624 can be used to rapidly identify the minimum baking time (by testing using design of experiments, a relatively low number of samples can be used to pinpoint this value). Then the same test can be used as a quality control check to evaluate if baking was sufficient on a per-batch basis. 
In the case of welding, often pre-heating and post-heating the metal is applied to allow the hydrogen to diffuse out before it can cause any damage. This is specifically done with high-strength steels and low alloy steels such as the chromium/molybdenum/vanadium alloys. Due to the time needed to re-combine hydrogen atoms into the hydrogen molecules, hydrogen cracking due to welding can occur over 24 hours after the welding operation is completed.
Another way of preventing this problem is through materials selection. This will build an inherent resistance to this process and reduce the need of post processing or constant monitoring for failure. Certain metals or alloys are highly susceptible to this issue, so choosing a material that is minimally affected while retaining the desired properties would also provide an optimal solution. Much research has been done to catalog the compatibility of  certain metals with hydrogen.
Tests such as ASTM F1624 can also be used to rank alloys and coatings during materials selection to ensure (for instance) that the threshold of cracking is below the threshold for hydrogen-assisted stress corrosion cracking. Similar tests can also be used during quality control to more effectively qualify materials being produced in a rapid and comparable manner.