According to Wiki: In statistics, the number of degrees of freedom is the number of values in the final calculation of a statistic that are free to vary.[1] Estimates of statistical parameters can be based upon different amounts of information or data. The number of independent pieces of information that go into the estimate of a parameter is called the degrees of freedom. In general, the degrees of freedom of an estimate of a parameter are equal to the number of independent scores that go into the estimate minus the number of parameters used as intermediate steps in the estimation of the parameter itself. For example, if the variance is to be estimated from a random sample of independent scores, then the degrees of freedom is equal to the number of independent scores (N) minus the number of parameters estimated as intermediate steps (one, namely, the sample mean) and is therefore equal to N-1.[2]
Reference:https://en.wikipedia.org/wiki/Degrees_of_freedom_(statistics)
I am confused that because we know the sample mean which means that $n$ observations are already known so why we can let $n-1$ observations be free to vary? I checked some videos and blogs: most of them explain that by using a example that if we have a sample of 3 and know the sample mean two of them are free to vary and the third observation will be determined by sample mean. But if we already know the sample mean why two of them are free to vary? I think these three observations are fixed.

