It's probably best to back up your files and reinstall Ubuntu. This will ensure that everything is fixed and that you don't forget anything. If you can't, there are a few things to look at.
You can reinstall packages with
sudo apt install --reinstall [package-name].
libz.so.1 is in the
$ locate libz.so.1 | grep -E '/libz.so.1$' | xargs -n 1 dpkg -S
dpkg-query: no path found matching pattern /snap/core/5145/lib/x86_64-linux-gnu/libz.so.1
dpkg-query: no path found matching pattern /snap/core/5328/lib/x86_64-linux-gnu/libz.so.1
dpkg-query: no path found matching pattern /snap/core/5548/lib/x86_64-linux-gnu/libz.so.1
Automatically check most installed files for errors
Once you get APT working properly, install the
debsums package and run
sudo debsums -s to list any missing or incorrect files that are supposed to be installed on your system (which won't help if you uninstalled them but can help otherwise). This doesn't handle all installed files, but it should handle missing libraries.
See what commands you ran
Your shell's history file will potentially contain the commands that you ran if you used the terminal to do so, so you can possibly find out what you did to change the files. If you're using Bash, you can usually look at it with