As kitdy has said correctly, the elements that are fused are deuterium and tritium. But, they are not burnt with oxygen to obtain water, a chemical reaction that gives us energy. Instead, the two hydrogen atoms are fusioned to create a helium atom, giving much much more energy. Think that way, if you take a H bomb and burn the hydrogen, you will have a small explosion, but if you ignite the fusion of that bomb using a nuclear bomb , you have a big big boom.
I found ths from wikipedia, copy-pasted:
so they are using only 0.5g
to obtain 500MW, that's 200 000 MJ of energy in all 400 seconds, from 0.5 g.
If we take 1kg of mixture, the output, would be 4E8 MJ/kg that, comparing to the energy released in the combustion of hydrogen ( 286 MJ/kg), is 1 398 601 times greater!!! so you need very few hydrogen, and lthough it is expensive to obtain deuterium and tritium, you see that it compensates.
About the process efficiency, with ITER they expect to obatain 5 or 10 times more energy that the consumed to maintain the fusion, so they are really producing energy, no wasting it.
If all goes well, the next step is DEMO, th first commercial reactor that will really produce electricity with the heat, 2000 MW continuously.
All, this is in wikipedia, if you want more info, my knowledge is limited to wikipedia