How can I password protect files in macOS?
You could put it in an encrypted disk image.

You can create an encrypted disk image in Disk Utility:


Open Disk Utility.
Go to File > New Image > Blank Image (Cmd+N).
Enter a filename, and choose a location. You can also choose the size of the disk image. Make sure to set Encryption to either 128 or 256 bit AES encryption (256 bit is more secure than 128 bit, but it's also slower.) You can keep all other settings the same.
Enter a passphrase for your disk image.
Ensure you have read/write disk image selected for Image Format (otherwise you won't be able to write to it)
You can now create the image. Once it's created, the disk image will be mounted. Copy the files you want to keep safe to the new disk.
Once you're done, eject the disk by dragging it to the Trash.


Now, whenever you want to access your encrypted files, just mount the image from wherever you saved it to earlier. Once you're done with your files, eject it as described earlier.