To make Coke in Dwarf Fortress you'll need Bituminous Coal or Lignite. Along with an operator who is good at handling the Furnace. Once you have all the required items head to the Smelter or Magma Smelter and you'll be good to go. Making the fuel by using Bituminous coal will produce 9 Coke and Lignite will get you 5.