A fuel cell is an electrochemical device that directly converts chemical energy into electricity. It parts from a reactive fuel (usually hydrogen) and an oxidizer (in many cases oxygen) to produce water, electricity (DC) and heat.
It has several parts:
On the anode side, hydrogen dissociates into protons and electrons. The protons are leaded through the membrane to the cathode, but the electrons are forced to go through an external circuit (producing power) because the membrane is electrically isolated. In the cathode catalyst, oxygen molecules react with electrons (leaded through the external circuit) and protons forming water. In this case, the only waste product is water vapor or liquid water.