Step 1: Picture a diatomic molecule.
A diatomic molecule is two atoms joined by a bond, like a tiny dumbbell. We count its independent ways of storing energy.
Step 2: Count translation.
The whole molecule can move along three independent directions, giving $3$ translational degrees of freedom.
Step 3: Count rotation.
It can spin about two axes perpendicular to the bond, giving $2$ rotational degrees of freedom. Spin about the bond axis itself stores negligible energy and is not counted.
Step 4: Look at vibration.
Along the line joining the two atoms, the bond can stretch and compress like a spring. This back and forth oscillation is a single independent vibrational mode.
Step 5: Count the vibrational modes.
Because there is only one bond and one line of vibration, the molecule has exactly $1$ vibrational degree of freedom.
Step 6: Conclude.
The number of vibrational degrees of freedom of a diatomic molecule is $1$.
\[ \boxed{1} \]