Forgetting a password for an app you open twice a year is not hard. The way back in is short, and it is in the FAQ.
Stop the container first. Then open config.xml in the Sonarr appdata folder and find the AuthenticationMethod line. It reads Basic or Forms. Remove the whole line, start Sonarr again, and the web interface asks you to set a new username and password.
On Unraid the file sits in the appdata share of the container, so I would edit it from the terminal or through the share.
<AuthenticationMethod>Forms</AuthenticationMethod> <- delete this line
The wiki asks you to check that the file does not contain two AuthenticationMethod lines. Remove them all, then start the app.
The caveat is the obvious one. Anyone who can write to your appdata share can do the same, so it is one more reason to keep that share closed. Also make a copy of config.xml before you touch it, because the file holds your API key and your port as well.
Sonarr v4 made authentication mandatory, so the page that shows up after the restart is the new password screen. The same trick is described in the Prowlarr and Radarr FAQs.
Further reading: Sonarr FAQ, Servarr Wiki, Sonarr settings, Servarr Wiki, On this site: click Backup now in Sonarr and Radarr, then take the zip off the server, On this site: set Minimum Free Space in Sonarr and Radarr so a full disk stops the imports
Going deeper: Guide: link Prowlarr to Sonarr and Radarr once, and stop typing indexers into every app