You can create a folder directly in Finder. Navigate to the desired directory and create a folder. We will create an encrypted disk image from this folder. The files we want to secure will go inside of this folder.
Move any files that you wish to protect inside of the folder you just created.
You can find the Disk Utility app in Applications > Utilities or just hit cmd + space bar and search for "Disk Utility".
Click on File > New Image > Image From Folder.
A Finder window will appear. Find and select the folder you want to encrypt, then click Choose.
Choose a name and location for the image.
Keep in mind, ".dmg" will be automatically appended to the name you choose.
Then select either either 128 or 256 bit encryption.
By default, this will create a read-only image. If you'll need to write to this folder again in the future, change the Image Format to read/write.
Enter the password, verify, and click save.
This password will be required when you try to mount the disk image to view the contents so you should write down this password.
Use a strong password, and store it securely. Consider using a password manager like 1Password or Dashlane.
To test the image you've created, find the image in Finder and click to open. When prompted, enter the password you set previously. This will mount the image and display the contents of the folder.
When you're finished, make sure to unmount the image. You'll see the image in the left column of finder and you can click the eject icon to unmount.
Next security step...
Make sure that you are securely emptying your Mac's trash regularly.
If your file extensions aren't visible, you can adjust settings to always show file extensions in MacOS. Check out our guide to get started.
I always keep an eye on my MacBook's battery percentage—especially since, as a developer, I run a lot of resource-intensive applications.