A Hydrogen Fuel cell is an electrochemical device. It combines hydrogen gas and oxygen gas to produce electricity. The device also produces water as byproduct.
A Electrolyzer is also an electrochemical device. It uses electricity to break water molecule into hydrogen gas and oxygen gas.
You can tell both electrochemical reactions above are very similar. But the two reactions are reversed to each other.
In reality, people often use a Electrolyzer as a convenient on-site hydrogen generator. The hydrogen produced by the electrolyzer can serve as energy fuels, cooling agent, reduction gas, or feedstock for wide industrial applications.
On the other hand, people use Fuel Cells to power fuel cell vehicles such as cars, buses, trucks and forklifts.
Furthermore, we can combine electrolyzers and fuel cells in one system as backup power for residential and industrial buildings.