It will depend on the browser and O/S hosting the browser.
MacOS and safari - use safari push notifications
MacOS and chrome - use chrome notifications
IOS - no support, must use a native app
Android - use chrome notifications
Windows - use chrome notifications
Chrome notifications requires creating a service worker which are written in JavaScript.
https://developers.google.com/web/fundamentals/codelabs/push-notifications
Safari notifications
https://developer.apple.com/notifications/safari-push-notifications/