Coke is a form of fuel, used to power the various furnaces and the metalsmith's forge. It can also be used as a source of carbon in the production of steel. To make coke, you must dig up bituminous coal and "Make coal Bars" at a smelter. This will produce two bars of coke from each piece of bituminous coal.
Coke can be used interchangeably with charcoal, although it is better to use coke to preserve your wood supplies. Using magma furnaces will preserve both coke and charcoal. However, to begin the production of metal in your fortress, you will need at least one bar of charcoal to begin coke production. If you wish to make a magma smelter, you will need five bars of charcoal or coke to produce your first bar of steel.
Note: In custom stockpile settings ( - - ), "coal" includes both charcoal and coke.
The only difference between charcoal and coke, besides their names and means of acquisition, is that Elven traders will be offended by charcoal but not by coke.