An electrolyzer is an electrochemical device made of membranes and electrolytes; when it is powered by electricity, it can break the chemical bonds in a water molecule, separating hydrogen and oxygen, which can then be collected and stored.
A fuel cell is an electrochemical device similar to an electrolyzer. It’s made of membranes and electrolytes that are sometimes identical to the ones found in an electrolyzer, but it reverses the process: it uses hydrogen to create electricity. The molecules of the fuel (H2) and of the combustive agent (usually oxygen, O2) are broken down into positive ions and electrons, which then go through an external circuit, generating an electrical current. The H+ and O- ions then combine, creating water (H2O) as its only waste product.