A web app or a download client has no business in /home. One line in its unit file makes sure it can’t look there even if it gets compromised.
Add it with a drop-in, so package updates don’t overwrite your change:
sudo systemctl edit myapp.service
[Service]
ProtectHome=yes
Then sudo systemctl restart myapp. For that service, /home, /root and /run/user are now empty and inaccessible. The rest of the system sees nothing different.
There are two softer values. read-only keeps the folders visible but stops writes, and tmpfs mounts an empty read-only file system over them. I’d start with yes and only step down when the service really needs something in a home folder.
To check what the service sees, run a quick command in the same sandbox:
sudo systemd-run -p ProtectHome=yes --wait --pipe ls /home
That should list nothing. The catch is services that keep their data in a home folder, such as an app running as a user whose files live under /home/app. With yes they fail to start or can’t find their data. Move the data to /var/lib/app, or use BindPaths= to let in the one folder the service needs.
Further reading: systemd.exec(5): ProtectHome=