The setup docs do something I like: the example compose file names an exact image version instead of latest.
image: 'jc21/nginx-proxy-manager:2.17.0'
To upgrade you edit that version, then run the two commands from the Upgrading page:
docker compose pull
docker compose up -d
The docs say the project updates the database and other requirements itself, so there are no manual migration steps. Each release lists its own specifics, and reading them before you pull is a better habit than I give it credit for.
What the docs do not cover is backups. My own habit is to copy the data and letsencrypt folders somewhere safe before an upgrade, since those two volumes hold the database, the certificates and your custom snippets. That is my advice, not an official step.
Caveat: a pinned version does not update itself. That is the point, but it also means you carry the job of noticing security releases. Put it on a calendar.
Rolling back is the same move in reverse. Put the old version number back and run the up command again. Whether an old image can read a database that a newer release has already changed is not something the docs promise, so the backup matters more than the rollback.
Further reading: Nginx Proxy Manager: Setup, Nginx Proxy Manager: Upgrading, On this site: Nginx Proxy Manager has a health check, you just have to switch it on, On this site: DISABLE_IPV6 fixes the "Address family not supported" error in Nginx Proxy Manager, On this site: Guide: put Nextcloud behind Nginx Proxy Manager with HTTPS and the right headers
Going deeper: Guide: fix a 502 Bad Gateway in Nginx Proxy Manager, with a checklist that finds the cause