Create a new folder, for my example the folder is named "secretstuff".
Copy whatever files, folders or content you want to protect into the secretstuff folder.
Launch the Disk Utility, from the file menu, select new image, image from folder.
I selected the folder I created from step 1 above. Set the encryption to 256-bit AES, and the image format to compressed. Select Save. When prompted, provide a long and strong password, store the password in a safe place separate from the folder and the final dmg file once created.
A new secretstuff.dmg file will be created, dont forgot to delete the source secretstuff folder, but leave the secretstuff.dmg file.
If you want to access the contents of the secretstuff.dmg file, you may do so by using the same Disk Utility tool, from the file menu, select open disk image, when prompted enter the password created above during step 4.