A locksmith’s file is a bar of hardened steel with a ridged surface, used to remove material from a metal part by hand, little by little and with control. There are flat, round, half round, triangular and needle files, with a coarser or finer cut.
It is the tool for fine adjustments: enlarging a keep slightly so that the latch goes in without forcing, cleaning up the burrs of a cut or a drilled hole, or adjusting a stop or a lock part that rubs. Many doors that are hard to close are sorted out with a good adjustment, without replacing anything.
A tip: if your lock only locks when you push the door, do not force the key. Most likely the latch is not lining up with the keep and it needs adjusting. See door repair and adjustment.