Mac storage basics · Disks, APFS and formats
How do I archive a folder as a compressed disk image on a Mac?
Short answer: In Disk Utility choose File → New Image → Image from Folder, set the format to compressed, and save. Check it opens before deleting the original.
Open Disk Utility and choose File → New Image → Image from Folder…. Pick the folder, then set Image Format to compressed and save the image (on an external drive, if it's an archive).
You get one .dmg file that opens like a disk when double-clicked. Compression helps with documents and code but not much with photos or video, which are already compressed. Check the image opens and the files are there before deleting the original folder. Zip is the simpler alternative: does zipping save space.