Instructions
Charcoal
Gather some wood. You should have began gathering wood at the start of your game. If you are low on wood, you may want to only make a limited amount of charcoal.
Build a wood furnace somewhere in your fortress. Placing your wood furnace near your wood piles will save time later.
Set one of your dwarves to have the "Wood Burning" labor. This will be necessary to use the wood furnace.
Set a standing order to create charcoal. Your wood burning dwarf will craft your charcoal.
Coke
Collect either bituminous coal or lignite, both of which can be found in the sedimentary layer of your map.
Collect fuel such as charcoal or another piece of coke. This will be necessary to run the smelter unless you have a magma smelter, which is powered by magma and needs no additional fuel.
Build either a normal smelter or a magma smelter. Placing your smelter near your resource piles will save time later.
Set one of your dwarves to have the "Furnace Operating" labor. This will be necessary to use the smelter.
Set a standing order to create coke. Your furnace operating dwarf will craft your coke.