Divide the net power produced by the energy you put in. This is the efficiency of the total system. Sometimes people only look at stack efficiency and neglect the power needed for the balance of plant.
In case of combined heat and power, one should make a difference between electric efficiency (power/energy of feed), heating efficiency (usable heat/energy of feed) and total efficiency (power + usable heat divided by energy of feed)
Officially one should use the high heating value of the feed. In many cases one uses the lower heating value as this mimics the way energy efficiency of heating appliances are calculated in many countries.