A signed contract, a final invoice, the master copy of a logo: once a file is done, I don’t want anything to change it, not even me in a hurry.
Select the file in Finder, press Command-I and tick Locked in the Info window.
select the file
Command-I (File > Get Info)
[x] Locked
The lock is a guard rail, and it shows most when you delete. Apple’s guide on deleting files says that when an item is locked, you have to confirm with Continue before it moves to the Trash, or unlock it first by clearing the Locked checkbox in Get Info. That extra question is the whole point: Command-Delete on a selection no longer takes the locked file along silently.
An example: lock the final PDF of your tax return in its folder. When you clean up the drafts next to it later, the final one asks before it goes.
It’s protection against mistakes, not a security feature. Anyone using your account can untick the box, and Apple notes that without admin rights you may need an administrator name and password to unlock some items. It also doesn’t stop a file from being copied or read, so for sensitive documents encryption is what you want.
Further reading: Delete files and folders on Mac (Apple), Get file, folder, and disk information on Mac (Apple)