Easy way: right-click files in the Files app, then Compress. Right-click an archive, then Extract Here.
Terminal:
zip -r photos.zip Photos: zip a folder
unzip photos.zip: unzip
tar -czf backup.tar.gz Documents: make a compressed .tar.gz
tar -xzf backup.tar.gz: extract a .tar.gz
tar -tzf backup.tar.gz: list what's inside without extracting
If zip or unzip are missing: sudo apt install zip unzip
For .rar and .7z files: sudo apt install unrar p7zip-full