Engineering, controlling, and simulating quantum dynamics is a strenuous task. However, these techniques are crucial to develop quantum technologies, preserve quantum properties, and engineer decoherence. Earlier results have demonstrated reservoir engineering, construction of a quantum simulator for Markovian open systems, and controlled transition from Markovian to non-Markovian regime. Dephasing is an ubiquitous mechanism to degrade the performance of quantum computers. However, all-purpose quantum simulator for generic dephasing is still missing. Here, we demonstrate full experimental control of dephasing allowing us to implement arbitrary decoherence dynamics of a qubit. As examples, we use a photon to simulate the dynamics of a qubit coupled to an Ising chain in a transverse field and also demonstrate a simulation of nonpositive dynamical map. Our platform opens the possibility to simulate dephasing of any physical system and study fundamental questions on open quantum systems.