Dilithium is a crystalline substance used to regulate matter-antimatter reactions in Star Trek warp cores. Dilithium is a natural material typically mined from planets. It is apparently impossible to replicate, but decaying crystals can be made to "restructure" themselves via exposure to photons captured from a nuclear fission reaction.
Dilithium crystals degrade over time in an operating warp core, particularly if the warp core runs at high output for an extended period of time. The orientation of crystals in the warp core affects the efficiency of the matter-antimatter reaction and can allow the warp core to accept reactants at a greater rate.
Dilithium is supposed to be carefully shaped and positioned within a warp core to provide an efficient reaction, but unworked or broken crystals can be installed in an emergency to get the warp drive working.