There are different strategies that you can use to allow a user to opt-out from the push notifications of a website that they have previously enabled.
Articles about web push notifications
A "push subscription" represents a subscriber to the push notifications of a website.
These two methods defined by the Push API are used to get the push subscription from the browser. What is the difference between them?
How can you verify that a push subscription is still valid (and not invalid or expired)? How can you detect if a user has unsubscribed and the subscription is no longer valid?
When a user is visiting your website and subscribes to notifications, you get a push subscription, which must be stored somewhere (in a database) in order to send notifications to that user.
If you are implementing web push notifications on a website you should be familiar with the concept of endpoint.