@harrymc has answered how to brute-flush your cache. Here's a method to go website-by-website, understanding a bit more about what's going on.
Ìf you insert
[chrome/edge/vivaldi/...]://serviceworker-internals/ into the address bar, you can see all registered service workers. However, unregistering them thorugh that page won't clear the cache, as this comprehensive article on love2dev notes.
Instead, if for example
youtube.comhas registered a serviceworker, navigate to that website and open the developer console. Open the 'Application' tab and the 'Storage' item.
Here, you'll see how much storage your service worker occupies, and you can select which data to clear for that website, for example retaining only the cookies.
Note that the service worker will restart as soon as you navigate to that site again.
If you wish to choose which applications can install a service worker on your system, follow the steps described in this article, using the uBlock plugin.
It's a wild guess, but 5GB of ServiceWorker storage is probably some webmail client with offline content enabled: it is fundamental to understand that serviceworkers were initially conceived for mobile devices who are not always online, and thus will cache some web-application data on the local system. Also, a serviceworker can receive push messages for an inactive webapp, and wake up that app. Gmail is a prime example: on mobile, you can read & write email while offline, and it will sync as soon as you go online. And even if the gmail app is not active after a phone restart, the serviceworker will receive the push message that you have something new in your inbox.
As such, on a PC which is always connected to internet, serviceworkers are not really necessary, except maybe to speed up the experience on some websites. It could however be that nowadays some websites simply won't work correctly if you block their serviceworker (but I'd say that's bad coding practice).
For a more comprehensive understanding, read the two linked articles. Also, Googles Introduction to Service Workers can shed some more light on what's going on.