After you remove a show’s files, the folders stay behind: an empty series folder with an empty Season 01 inside. Sonarr can tidy those.
The setting is called Delete Empty Folders, under Settings, Media Management, in the Folders part. The Servarr wiki says that Sonarr then deletes empty series and season folders during a disk scan and when episode files are deleted.
Right under it is Create Empty Media Folders, which makes missing series folders during a disk scan. The two pull in opposite directions, so I would pick one. If you want folders to exist before the first episode is imported, the second one is yours. If you prefer a library with no empty shells, take the first.
Try it on one old show first and see what disappears, before you let it loose on the whole library.
The caveat is that it acts on a scan. If you delete files with another tool and want the folders gone, the cleanup happens at the next scan, depending on how Rescan Series Folder after Refresh is set.
The wiki entry is short on detail here. It doesn’t say what happens to a folder that still holds leftovers such as subtitles or images, so I’d read empty literally and not count on the setting to clear out a folder with anything in it. Check one show with a few stray files before you rely on it.
Further reading: Sonarr settings, Folders (Servarr wiki)
Going deeper: Guide: link Prowlarr to Sonarr and Radarr once, and stop typing indexers into every app