Generally speaking, the line element can be written as $$ds^2=g_{\mu\nu}(x)dx^{\mu}dx^{\nu},$$ where $g_{\mu\nu}(x)$ are the metric components at the point $(x^0,x^1,x^2,x^3)$. For example, working in cartesian coordinates $(t,x,y,z)$, for the Minkowski metric $g_{\mu\nu}(x)=\text{diag}(-1,1,1,1)$, this simply becomes $$ds^2=-dt^2+dx^2+dy^2+dz^2.$$
Proper time is the time experienced by an observer as it reads on their own clock. This means that an observer would describe their position in spacetime, in their coordinates, say $(t',x',y',z')$, to be $(\tau,x_0,y_0,z_0)$, where $\tau$ is the proper time measured by the observer and $x_0,y_0,z_0$ are constants (because in their coordinates the observer is always at rest and everything else moves around them).
In particular, this implies that $dx'=dy'=dz'=0$ in the observer's coordinates. So, in this set of coordinates, the line element reads $$ds^2=g'_{\mu\nu}(x')dx'^{\mu}dx'^{\nu}=g'_{00}(\tau,x_0,y_0,z_0) d\tau^2.$$
Now, for an inertial observer (i.e. an observer moving freely on a geodesic), their coordinates are given by the inertial coordinates at the point where the observer is. These coordinates have a couple of important properties: the vanishing of the Christoffel symbols and the fact that the metric is given by the Minkowski metric at the point where the observer is (this goes for both statements). In other words, $g'_{\mu\nu}(\tau,x_0,y_0,z_0)=\text{diag}(-1,1,1,1)$ and the above becomes $ds^2=-d\tau^2$.
For a non-inertial observer, I must admit I have never seen a good explanation of what is meant by "their coordinates" in this case. I believe even in this case there exists a set of coordinates such that the metric at the point where the observer is is still given by the Minkowski metric, so the above argument for the line element is unchanged (the difference in this case being that the Christoffel symbols do not vanish anymore). Maybe someone more knowledgeable may correct me on this one if I am wrong.