Symptom

You see an error message similar to this:

MiKTeX cannot access the file '{path}' because it is either locked by another MiKTeX program or by the operating system.

How to fix

Some TeX editors are configured to run MiKTeX programs like pdflatex in parallel. Use another TeX editor and see if this fixes the issue.