Phosgene can be produced by the reaction of carbon monoxide and chlorine gas in the presence of a catalyst. It can also be generated as a byproduct in various chemical processes, particularly when chlorinated hydrocarbons are exposed to high temperatures.