What is the best solution for a jamming lock?

What is the best solution for a jamming lock?

I mean the lock on the door, not on the pants, grease, oil, or maybe something else?

First thing, which we are thinking about, there is WD lubricant when the lock seizes 40 or oil for sewing machines. However, these measures only work temporarily, and besides, dust and dirt stick to them. After some time, the lock jams again and the problem unfortunately returns. So the best solution is not grease, but graphite powder, preferably in a package with an applicator.

Apply graphite to the key and to the keyhole.
If there is a patent lock or the handle is jammed, sometimes the liner has to be removed before applying the graphite (cylinder) or remove the handle.
The lock bolt requires separate lubrication. We put the right amount of graphite on it, so that it moves freely.
And that's the end of this minor repair – the lock should work fine again. Truth, that simple.

Thanks for the reply, I guess I'll have to buy that graphite powder.