Decoherence is an essential mechanism that defines the boundary between classical and quantum behaviours, while imposing technological bounds for quantum devices. Little is known about quantum coherence of mechanical systems, as opposed to electromagnetic degrees of freedom. But decoherence can also be thought of in a purely classical context, as the loss of phase coherence in the classical phase space. Indeed the bridge between quantum and classical physics is under intense investigation, using, in particular, classical nanomechanical analogues of quantum phenomena. In the present work, by separating pure dephasing from dissipation, we quantitatively model the classical decoherence of a mechanical resonator: through the experimental control of frequency fluctuations, we engineer artificial dephasing. Building on the fruitful analogy introduced between spins/quantum bits and nanomechanical modes, we report on the methods available to define pure dephasing in these systems, while demonstrating the intrinsic almost-ideal properties of silicon nitride beams. These experimental and theoretical results, at the boundary between classical nanomechanics and quantum information fields, are prerequisite in the understanding of decoherence processes in mechanical devices, both classical and quantum.