to compress any newly added file/directory – mount the file system with option compression=algorithm:compressionLevel e.g.:
mount -o compress=zstd:12 /dev/mapper/something /mnt/somewhere
to compress individual file or folder, without compressing everything else stored on given file system:
btrfs property set /path/to/file/or/folder compression zstd
btrfs filesystem defragment -r -v -czstd /path/to/file/or/folder
to check compression ratio:
compsize /path/to/file/or/folder
to check compression property for an existing folder:
btrfs property get /path/to/folder compression
for more details – see https://btrfs.readthedocs.io/en/latest/Compression.html